]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Patch from David Mosberger to fix 32 host cross 64 target bug.
authorDavid Mosberger <davidm@hpl.hp.com>
Mon, 14 Jun 1999 13:10:29 +0000 (13:10 +0000)
committerJim Wilson <wilson@gcc.gnu.org>
Mon, 14 Jun 1999 13:10:29 +0000 (06:10 -0700)
        * combine.c (simplify_logical, case AND): Only call
        simplify_and_const_int if the mode is no wider than HOST_WIDE_INT
or the constant is positive.

From-SVN: r27517

gcc/ChangeLog
gcc/combine.c

index ea6fbbb6ef88ca96d864430f41bfb52d4c403a64..2f6b1a45873f0d0b45b6820889a9434f13f6fb76 100644 (file)
@@ -1,3 +1,9 @@
+Mon Jun 14 12:57:38 1999  David Mosberger  <davidm@hpl.hp.com>
+
+        * combine.c (simplify_logical, case AND): Only call
+        simplify_and_const_int if the mode is no wider than HOST_WIDE_INT
+       or the constant is positive.
+
 Mon Jun 14 11:43:41 1999  Nick Clifton  <nickc@cygnus.com>
 
        * configure.in: Fix typo in rs6000-ibm-aix4 case.
index 0b64a86a548cea520f790ed0b947e1beb20399c2..60e0ef27efcbfb701259dd574294491ce70a4b65 100644 (file)
@@ -4902,7 +4902,12 @@ simplify_logical (x, last)
          && ! side_effects_p (op1))
        x = gen_binary (AND, mode, XEXP (XEXP (op0, 0), 0), op1);
 
-      if (GET_CODE (op1) == CONST_INT)
+      /* We can call simplify_and_const_int only if we don't lose
+        any (sign) bits when converting INTVAL (op1) to
+        "unsigned HOST_WIDE_INT".  */
+      if (GET_CODE (op1) == CONST_INT
+         && (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT
+             || INTVAL (op1) > 0))
        {
          x = simplify_and_const_int (x, mode, op0, INTVAL (op1));