From 266b3bff466506468e574941d1563c9d837cf0f9 Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Tue, 6 Feb 2007 19:50:30 +0000 Subject: [PATCH] * src/SDCCBlock.c (addiCodeToeBBlock): fixed bug 1652207: GOTO icodes appended by loop induction must be at the very end of the eBBlock git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4620 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ src/SDCCBBlock.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0944b5d9..5e2bcd5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-02-06 Bernhard Held + + * 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 * support/regression/fwk/lib/timeout.c: native WIN32 port, diff --git a/src/SDCCBBlock.c b/src/SDCCBBlock.c index 9d9558ed..28d56e5a 100644 --- a/src/SDCCBBlock.c +++ b/src/SDCCBBlock.c @@ -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; -- 2.47.2