aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid Mosberger <davidm@hpl.hp.com>1999-06-14 13:10:29 +0000
committerJim Wilson <wilson@gcc.gnu.org>1999-06-14 06:10:29 -0700
commit2e8f9abf1701a94e8dd09384faf2777455333f20 (patch)
tree3539a1dcbd89df0f0c705a28344d912747c18faf /gcc
parent69c9f0fbbc6e5f16d86473b0cc68b139ca49c08b (diff)
downloadgcc-2e8f9abf1701a94e8dd09384faf2777455333f20.zip
gcc-2e8f9abf1701a94e8dd09384faf2777455333f20.tar.gz
gcc-2e8f9abf1701a94e8dd09384faf2777455333f20.tar.bz2
Patch from David Mosberger to fix 32 host cross 64 target bug.
* 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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/combine.c7
2 files changed, 12 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ea6fbbb..2f6b1a4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/combine.c b/gcc/combine.c
index 0b64a86..60e0ef2 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -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));