From ea914976dfeb8f841e6530ef6d81a778c8bc0e88 Mon Sep 17 00:00:00 2001 From: epetrich Date: Wed, 16 Mar 2005 06:20:13 +0000 Subject: [PATCH] * src/SDCCcse.c (cseBBlock): retain assignment to self when volatile * src/SDCCast.c (isLoopCountable): fixed bug #1161985 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3697 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 5 +++++ src/SDCCast.c | 2 ++ src/SDCCcse.c | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9f4e7af7..827acfad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-03-16 Erik Petrich + + * src/SDCCcse.c (cseBBlock): retain assignment to self when volatile + * src/SDCCast.c (isLoopCountable): fixed bug #1161985 + 2005-03-15 Maarten Brock * device/lib/printf_large.c: removed inline assembly for portability and diff --git a/src/SDCCast.c b/src/SDCCast.c index f872f88c..e0ea695a 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -1533,6 +1533,8 @@ isLoopCountable (ast * initExpr, ast * condExpr, ast * loopExpr, } } + else + return FALSE; /* check loop expression is of the form ++ */ if (!IS_AST_OP (loopExpr)) diff --git a/src/SDCCcse.c b/src/SDCCcse.c index 1e07bb45..05c6e2e6 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -2057,7 +2057,7 @@ cseBBlock (eBBlock * ebb, int computeOnly, /* if after all this it becomes an assignment to self then delete it and continue */ - if (ASSIGNMENT_TO_SELF (ic)) + if (ASSIGNMENT_TO_SELF (ic) && !isOperandVolatile (IC_RIGHT(ic), FALSE)) { remiCodeFromeBBlock (ebb, ic); continue; -- 2.30.2