* src/SDCCBlock.c (addiCodeToeBBlock): fixed bug 1652207: GOTO icodes appended by...
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 6 Feb 2007 19:50:30 +0000 (19:50 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 6 Feb 2007 19:50:30 +0000 (19:50 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4620 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCBBlock.c

index 0944b5d9450919f92f0e142ba2e72b56205c2f13..5e2bcd5a00f13d8ad47e4af7a77a6eb537def328 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-02-06 Bernhard Held <bernhard AT bernhardheld.de>
+
+       * src/SDCCBlock.c (addiCodeToeBBlock): fixed bug 1652207: GOTO icodes
+       appended by loop induction must be at the very end of the eBBlock
+
 2007-02-05 Borut Razem <borut.razem AT siol.net>
 
        * support/regression/fwk/lib/timeout.c: native WIN32 port,
index 9d9558edb37120a60729eb96149c5b762a626cf8..28d56e5a99645bc66c2e046bb167573cb1a65a5c 100644 (file)
@@ -463,7 +463,10 @@ addiCodeToeBBlock (eBBlock * ebp, iCode * ic, iCode * ip)
   /* if this is true then we put it before the condition else */
   /* we put it before if, this is to reduce register pressure, */
   /* we don't have to hold  condition too long in a register  */
-  if (ebp->ech->op == IFX)
+
+  /* loop induction sometimes appends a GOTO instruction, */
+  /* it must be at the very end */
+  if (ebp->ech->op == IFX && ic->op != GOTO)
     {
       iCode *ipoint;