i had a similar effect with 2.3.1. It worked to switch loop invariant
optimization off (option -=96noinvariant). I have prepared a bug report
for this last week, where you can clearly see in the assemley dump that
a register where a loop invariant expression is stored is overwritten
somewhere. Sorry for not sending this in yet, but i moved with my lab
and don't have my network up there yet. If this bug is not yet known, i
promise to send the bug report asap.
> -----Original Message-----
> From: sdcc-user-admin@...
> [mailto:sdcc-user-admin@... Behalf Of Matthias
> Sent: Wednesday, May 29, 2002 4:30 PM
> To: Bernhard Held
> Cc: sdcc-user@...
> Subject: Re: [Sdcc-user] calculation with long variables
> > > xdata unsigned char idebuf;
> > > unsigned char j =3D 0;
> > > ...
> > > uc_strcpy(&idebuf[(i-32+1)-j*32],&lfn[j*13],5);
> > > uc_strcpy(&idebuf[(i-32+14)-j*32],&lfn[(j*13)+5],6);
> > > uc_strcpy(&idebuf[(i-32+28)-j*32],&lfn[(j*13)+11],2);
> > >
> > > if ((idebuf[(i-32-j*32)] & 0x40) =3D=3D 0x40) break;
> > j*32 is calculated as 8x8 bit multiplication and will overflow very
> > You will only get correct results in the range 0 <=3D j <=3D 7. Fix:
> > ... - (unsigned) j * 32] ...
> i expect this should be a (unsigned int)?
> > Tell me, if this doesn't help.
> The Problem is that the calcultion fails even when j =3D 1
> Matthias Wei=DFer
> Don't miss the 2002 Sprint PCS Application Developer's Conference
> August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm
> Sdcc-user mailing list