aboutsummaryrefslogtreecommitdiff
path: root/gcc/cse.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cse.c')
-rw-r--r--gcc/cse.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/gcc/cse.c b/gcc/cse.c
index 71bc358..9bcdcc3 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -4482,7 +4482,14 @@ simplify_relational_operation (code, mode, op0, op1)
else
{
l0u = l0s = INTVAL (op0);
- h0u = 0, h0s = l0s < 0 ? -1 : 0;
+ h0s = l0s < 0 ? -1 : 0;
+ /* If WIDTH is nonzero and larger than HOST_BITS_PER_WIDE_INT,
+ then the high word is derived from the sign bit of the low
+ word, else the high word is zero. */
+ if (width != 0 && width > HOST_BITS_PER_WIDE_INT)
+ h0u = l0s < 0 ? -1 : 0;
+ else
+ h0u = 0;
}
if (GET_CODE (op1) == CONST_DOUBLE)
@@ -4493,7 +4500,14 @@ simplify_relational_operation (code, mode, op0, op1)
else
{
l1u = l1s = INTVAL (op1);
- h1u = 0, h1s = l1s < 0 ? -1 : 0;
+ h1s = l1s < 0 ? -1 : 0;
+ /* If WIDTH is nonzero and larger than HOST_BITS_PER_WIDE_INT,
+ then the high word is derived from the sign bit of the low
+ word, else the high word is zero. */
+ if (width != 0 && width > HOST_BITS_PER_WIDE_INT)
+ h1u = l1s < 0 ? -1 : 0;
+ else
+ h1u = 0;
}
/* If WIDTH is nonzero and smaller than HOST_BITS_PER_WIDE_INT,