From: johanknol Date: Thu, 21 Feb 2002 13:56:39 +0000 (+0000) Subject: fixed bug no 514308 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=3fce831ce807979933ca71ae6ad79ef78f606e99;p=fw%2Fsdcc fixed bug no 514308 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1942 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCcse.c b/src/SDCCcse.c index 7f439dc7..6141c05b 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -1617,12 +1617,18 @@ cseBBlock (eBBlock * ebb, int computeOnly, /* Alternate code */ if (pdic && IS_ITEMP(IC_RESULT(ic))) { + if (POINTER_GET(ic) && (pdic->level < ic->level)) { + /* Mmm, found an equivalent pointer get at a lower level. + This could be a loop however with the same pointer set + later on */ + } else { /* if previous definition found change this to an assignment */ ic->op = '='; IC_LEFT(ic) = NULL; IC_RIGHT(ic) = operandFromOperand(IC_RESULT(pdic)); SET_ISADDR(IC_RESULT(ic),0); SET_ISADDR(IC_RIGHT (ic),0); + } } if (!(POINTER_SET (ic)) && IC_RESULT (ic)) {