From: johanknol Date: Thu, 17 Apr 2003 09:32:03 +0000 (+0000) Subject: fixed bug #720667 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3f8fe3157b6f63aa401b792d703147da3dc604fd;p=fw%2Fsdcc fixed bug #720667 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2532 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index c8bcb1d9..bc9a959a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2003-04-17 + + * src/mcs51/ralloc.c (packRegisters): fixed bug #720667 + 2003-04-13 Borut Razem * doc/sdccman.lyx: updated info about #pragma SAVE/RESTORE nesting diff --git a/src/mcs51/ralloc.c b/src/mcs51/ralloc.c index 6289a4a2..795237d2 100644 --- a/src/mcs51/ralloc.c +++ b/src/mcs51/ralloc.c @@ -1574,30 +1574,6 @@ regTypeNum (eBBlock *ebbs) continue; } -#ifdef RANGEHUNT - /* if this symbol has only one usage and that is an assignment - to a ruonly, we don't need registers */ - // if this symbol has only one def - if (bitVectnBitsOn (sym->defs)==1) { - printf ("sym: %s has only one usage", sym->name); - // find that usage - if ((ic = hTabItemWithKey (iCodehTab, bitVectFirstBit (sym->defs)))) { - if (ic->op==CALL) { - printf (" for a call "); - // if this is only assigned to a ruonly - if ((ic = hTabItemWithKey (iCodehTab, bitVectFirstBit (sym->defs)))) { - if (ic->op=='=') { - if (OP_SYMBOL(IC_RESULT(ic))->ruonly) { - printf("regTypeNum: %s assigned to %s\n", \ - sym->name, OP_SYMBOL(IC_RESULT(ic))->name); - } - } - } - } - } - } -#endif - /* if the symbol has only one definition & that definition is a get_pointer */ if (bitVectnBitsOn (sym->defs) == 1 && @@ -2601,7 +2577,8 @@ packRegisters (eBBlock ** ebpp, int blockno) cast is remat, then we can remat this cast as well */ if (ic->op == CAST && IS_SYMOP(IC_RIGHT(ic)) && - OP_SYMBOL(IC_RIGHT(ic))->remat ) { + OP_SYMBOL(IC_RIGHT(ic))->remat && + bitVectnBitsOn (OP_DEFS (IC_RESULT (ic))) == 1) { sym_link *to_type = operandType(IC_LEFT(ic)); sym_link *from_type = operandType(IC_RIGHT(ic)); if (IS_GENPTR(to_type) && IS_PTR(from_type)) {