]> git.gag.com Git - fw/sdcc/blobdiff - src/SDCCicode.c
Shift integer promotion behavior is controlled by -ansiint option
[fw/sdcc] / 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);