From: johanknol Date: Sun, 3 Mar 2002 10:52:53 +0000 (+0000) Subject: fixed bug #524685 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=ecbc63d3609e647e95fd9303137f4f516dd6fcab;p=fw%2Fsdcc fixed bug #524685 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1985 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/SDCCicode.c b/src/SDCCicode.c index d609f377..dd8dca5f 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -1904,10 +1904,12 @@ geniCodeDivision (operand * left, operand * right) resType = usualBinaryConversions (&left, &right); - /* if the right is a literal & power of 2 */ - /* then make it a right shift */ + /* if the right is a literal & power of 2 + and left is unsigned then make it a + right shift */ if (IS_LITERAL (retype) && !IS_FLOAT (letype) && + SPEC_USIGN(letype) && (p2 = powof2 ((unsigned long) floatFromVal (right->operand.valOperand)))) { ic = newiCode (RIGHT_OP, left, operandFromLit (p2)); /* right shift */