From: Sandeep D. <sa...@dd...> - 2001-03-25 22:49:00
|
The code generated now looks okay to me. mov r2,dpl mov r3,dph 1: mov dpl,r2 mov dph,r3 mov a,@dptr jz 2: push ar2 push ar3 call _pqr pop ar3 pop ar2 sjmp 1: 2: ... This is the correct behaviour , the pointer itself is help in registers since it is parameter. The *pointer is evaluated in every iteration. Sandeep -----Original Message----- From: sdc...@li... [mailto:sdc...@li...]On Behalf Of Johan Knol Sent: Sunday, March 25, 2001 8:56 AM To: sdc...@li... Subject: [sdcc-devel]Fixed: [ sdcc-Bugs-221220 ] Incorrect caching of global variables Sandeep fixed this bug in SDCCcse.c:1.19 but for some reasons it was still there. I did this the hard way in SDCCloop.c:loopInvariants(), because I still don't understand the applyToSet() issue. Can some one please fill me in on that. Johan > >Comment By: David A. Long (dalong) > Date: 2001-03-24 12:44 > > Message: > Logged In: YES > user_id=99385 > > I developed the following reproducer: > > extern void pqr(void); > > xyz(xdata char *x) > { > while(*x) > pqr(); > } > > The generated code still has the contents of location "x" > cached in a register inside the loop. If pqr() happens to > alter the contents of "x", it will never be noticed by the > while condition code. I just repeated this experiment with > a compiler built from the CVS sources of March 24, 2001 and > I got the same results. _______________________________________________ sdcc-devel mailing list sdc...@li... http://lists.sourceforge.net/lists/listinfo/sdcc-devel |