]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* optabs.c (expand_binop): Convert CONST_INTs in all cases.
authorEric Botcazou <ebotcazou@multimania.com>
Wed, 4 Sep 2002 22:29:13 +0000 (22:29 +0000)
committerRichard Henderson <rth@gcc.gnu.org>
Wed, 4 Sep 2002 22:29:13 +0000 (15:29 -0700)
From-SVN: r56817

gcc/ChangeLog
gcc/optabs.c

index 6439ef6ef6e099238a72b8a43b456fde855a7b83..114e86e112c5ffc38442b75d97f9a97132a4e662 100644 (file)
@@ -1,3 +1,8 @@
+2002-09-04  Eric Botcazou  <ebotcazou@multimania.com>
+
+       PR c/7102
+       * optabs.c (expand_binop): Convert CONST_INTs in all cases.
+
 2002-09-04  Jason Thorpe  <thorpej@wasabisystems.com>
 
        * config/sparc/t-netbsd64: Disable multilib for now.
index d228e58d062b7b0970703aff6223a69129ab1592..1cf2803295de948ee8d6b732c71d0f0748de6fd7 100644 (file)
@@ -752,23 +752,18 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
        }
 
       /* In case the insn wants input operands in modes different from
-        the result, convert the operands.  It would seem that we
-        don't need to convert CONST_INTs, but we do, so that they're
-        a properly sign-extended for their modes; we choose the
-        widest mode between mode and mode[01], so that, in a widening
-        operation, we call convert_modes with different FROM and TO
-        modes, which ensures the value is sign-extended.  Shift
-        operations are an exception, because the second operand needs
-        not be extended to the mode of the result.  */
+        those of the actual operands, convert the operands.  It would
+        seem that we don't need to convert CONST_INTs, but we do, so
+        that they're properly zero-extended or sign-extended for their
+        modes; shift operations are an exception, because the second
+        operand needs not be extended to the mode of the result.  */
 
       if (GET_MODE (op0) != mode0
          && mode0 != VOIDmode)
        xop0 = convert_modes (mode0,
                              GET_MODE (op0) != VOIDmode
                              ? GET_MODE (op0)
-                             : GET_MODE_SIZE (mode) > GET_MODE_SIZE (mode0)
-                             ? mode
-                             : mode0,
+                             : mode,
                              xop0, unsignedp);
 
       if (GET_MODE (xop1) != mode1
@@ -776,8 +771,7 @@ expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
        xop1 = convert_modes (mode1,
                              GET_MODE (op1) != VOIDmode
                              ? GET_MODE (op1)
-                             : (GET_MODE_SIZE (mode) > GET_MODE_SIZE (mode1)
-                                && ! shift_op)
+                             : ! shift_op
                              ? mode
                              : mode1,
                              xop1, unsignedp);