From: Borut R. <bor...@gm...> - 2011-11-20 21:41:34
|
I agree to make the fix before release, so please commit it ASAP. Borut On 11/20/2011 04:31 PM, Philipp Klaus Krause wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > I'd like to fix bug #3440327 before the release of 3.1.0. > > See > https://sourceforge.net/tracker/index.php?func=detail&aid=3440327&group_id=599&atid=100599 > for details on the bug. It is a serious bug, since it results in bad > code being generated silently. > > I expect the fix to be rather low-impact, unlikely to affect code that > did not trigger by the bug. I am sure it does not affect ports other > than z80, gbz80, z180 and r2k. > > I propose the following fix: > > - --- src/z80/gen.c (Revision 7065) > +++ src/z80/gen.c (Arbeitskopie) > @@ -368,6 +368,10 @@ > extern bool regalloc_dry_run; > unsigned char regalloc_dry_run_cost; > > +/* WARNING: This function is dangerous to use. It works literally: > + It will return true if ic the the last use of op, even if ic might > + be executed again, e.g. due to a loop. Most of the time you will want > + to use isPairDead(), or ic->rSurv instead of this function. */ > static bool > isLastUse (const iCode *ic, operand *op) > { > @@ -8268,7 +8272,7 @@ > } > } > /* Fixup HL back down */ > - - if (getPairId (AOP (left)) == pair&& !isLastUse (ic, left)) > + if (getPairId (AOP (left)) == pair&& !isPairDead (pair, ic)) > for (size = AOP_SIZE (result)-1; size; size--) > { > emit2 ("dec %s", _pairs[pair].name); > > I have run the ucz80, ucz180 and ucr2k regression tests and found no > failures. > > Philipp > > P.S.: There are further problematic calls to isLastUse() in > src/z80/gen.c, but since they were not reported as bugs I would fix > those after the release. > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.11 (GNU/Linux) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAk7JHVoACgkQbtUV+xsoLpo82ACeK9qNTvR9oGHXjR9Tm8Mshg0t > KE0AoLLurrZSi9cvQEHE+2eMCVvlZrXM > =u+hJ > -----END PGP SIGNATURE----- > > ------------------------------------------------------------------------------ > All the data continuously generated in your IT infrastructure > contains a definitive record of customers, application performance, > security threats, fraudulent activity, and more. Splunk takes this > data and makes sense of it. IT sense. And common sense. > http://p.sf.net/sfu/splunk-novd2d > _______________________________________________ > sdcc-devel mailing list > sdc...@li... > https://lists.sourceforge.net/lists/listinfo/sdcc-devel > |