From: epetrich Date: Wed, 18 Aug 2004 05:06:00 +0000 (+0000) Subject: * src/z80/ralloc.c (packRegsForAssign): ported some bug fixes from the X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=877c9a93ee346a15f3650f34ba425c02aaf7bfda;p=fw%2Fsdcc * src/z80/ralloc.c (packRegsForAssign): ported some bug fixes from the mcs51 port git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3444 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 4bd5b641..552d7913 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,12 @@ +2004-08-18 Erik Petrich + + * src/z80/ralloc.c (packRegsForAssign): ported some bug fixes from the + mcs51 port + 2004-08-16 Slade Rich * src/pic/gen.c: Restored fn genRet as previous fix was incorrect. - 2004-08-14 Frieder Ferlemann * src/mcs51/gen.c (genJumpTab): jumptables for more than 16 switch diff --git a/src/z80/ralloc.c b/src/z80/ralloc.c index b480b990..07627790 100644 --- a/src/z80/ralloc.c +++ b/src/z80/ralloc.c @@ -1684,26 +1684,57 @@ packRegsForAssign (iCode * ic, eBBlock * ebp) if (SKIP_IC2 (dic)) continue; - if (IS_SYMOP (IC_RESULT (dic)) && - IC_RESULT (dic)->key == IC_RIGHT (ic)->key) - { - break; - } + if (dic->op == IFX) + { + if (IS_SYMOP (IC_COND (dic)) && + (IC_COND (dic)->key == IC_RESULT (ic)->key || + IC_COND (dic)->key == IC_RIGHT (ic)->key)) + { + dic = NULL; + break; + } + } + else + { + if (IS_TRUE_SYMOP (IC_RESULT (dic)) && + IS_OP_VOLATILE (IC_RESULT (dic))) + { + dic = NULL; + break; + } - if (IS_SYMOP (IC_RIGHT (dic)) && - (IC_RIGHT (dic)->key == IC_RESULT (ic)->key || - IC_RIGHT (dic)->key == IC_RIGHT (ic)->key)) - { - dic = NULL; - break; - } + if (IS_SYMOP (IC_RESULT (dic)) && + IC_RESULT (dic)->key == IC_RIGHT (ic)->key) + { + if (POINTER_SET (dic)) + dic = NULL; - if (IS_SYMOP (IC_LEFT (dic)) && - (IC_LEFT (dic)->key == IC_RESULT (ic)->key || - IC_LEFT (dic)->key == IC_RIGHT (ic)->key)) - { - dic = NULL; - break; + break; + } + + if (IS_SYMOP (IC_RIGHT (dic)) && + (IC_RIGHT (dic)->key == IC_RESULT (ic)->key || + IC_RIGHT (dic)->key == IC_RIGHT (ic)->key)) + { + dic = NULL; + break; + } + + if (IS_SYMOP (IC_LEFT (dic)) && + (IC_LEFT (dic)->key == IC_RESULT (ic)->key || + IC_LEFT (dic)->key == IC_RIGHT (ic)->key)) + { + dic = NULL; + break; + } + + if (IS_SYMOP (IC_RESULT (dic)) && + IC_RESULT (dic)->key == IC_RESULT (ic)->key) + { + dic = NULL; + break; + } + } }