From ecbc63d3609e647e95fd9303137f4f516dd6fcab Mon Sep 17 00:00:00 2001 From: johanknol Date: Sun, 3 Mar 2002 10:52:53 +0000 Subject: [PATCH] fixed bug #524685 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1985 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCicode.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 */ -- 2.47.2