From: jbess Date: Wed, 25 Apr 2001 13:10:37 +0000 (+0000) Subject: Fix ignoring cast bug : void test (unsigned u) { for (; (int) u >= 0;) ++u; } X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d322ac46b9630c789436f6bd33c5e0aa58b01905;p=fw%2Fsdcc Fix ignoring cast bug : void test (unsigned u) { for (; (int) u >= 0;) ++u; } git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@757 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCcse.c b/src/SDCCcse.c index 126addff..b02adc0e 100644 --- a/src/SDCCcse.c +++ b/src/SDCCcse.c @@ -300,7 +300,7 @@ DEFSETFUNC (findCheaperOp) IS_ITEMP (IC_RESULT (cdp->diCode))) *opp = IC_RESULT (cdp->diCode); - if (*opp) + if ((*opp)&&(SPEC_USIGN(operandType (cop))==SPEC_USIGN(operandType (*opp)))) { if ((isGlobalInNearSpace (cop) && @@ -327,7 +327,7 @@ DEFSETFUNC (findCheaperOp) return 1; } - + *opp=NULL; return 0; }