Shift integer promotion behavior is controlled by -ansiint option
authorkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 25 Jan 2001 21:45:44 +0000 (21:45 +0000)
committerkvigor <kvigor@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 25 Jan 2001 21:45:44 +0000 (21:45 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@536 4a8a32a2-be11-0410-ad9d-d568d2c75423

src/SDCCicode.c

index 2a8b24d0b9f1e7c7bdac9bb30ccd1f23ddfd12e1..047c4014c0327ed3a8755a58475a7f8407c24e09 100644 (file)
@@ -2244,8 +2244,11 @@ operand *geniCodeLeftShift (operand *left, operand *right)
     /* Note that we don't use the usual binary conversions for the 
      * shift operations, in accordance with our ANSI friends.
      */
-    right = usualUnaryConversions(right);
-    left = usualUnaryConversions(left);
+    if (options.ANSIint)
+    { 
+       right = usualUnaryConversions(right);
+       left = usualUnaryConversions(left);
+    }
 
     ic = newiCode(LEFT_OP,left,right);
     IC_RESULT(ic) = newiTempOperand(operandType(left),0);
@@ -2263,8 +2266,11 @@ operand *geniCodeRightShift (operand *left, operand *right)
     /* Note that we don't use the usual binary conversions for the 
      * shift operations, in accordance with our ANSI friends.
      */
-    right = usualUnaryConversions(right);
-    left = usualUnaryConversions(left);
+    if (options.ANSIint)
+    { 
+       right = usualUnaryConversions(right);
+       left = usualUnaryConversions(left);
+    }
     
     ic = newiCode(RIGHT_OP,left,right);
     IC_RESULT(ic) = newiTempOperand(operandType(left),0);