summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1996-12-16 20:27:35 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1996-12-16 20:27:35 +0000
commit54c9abc009c319097cec94a3a18e1b35c5f23629 (patch)
tree2988a18be8f17b49ec7b16d803ebebbb45755b97
parentb21218d652054feaca0417eee2f498a98f418ccc (diff)
downloadgcc-54c9abc009c319097cec94a3a18e1b35c5f23629.tar.gz
(simplify_comparison): Use mode_width as shift count
only if it is less than or equal to HOST_BITS_PER_WIDE_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@13312 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/combine.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 38641104f19..f4e0b97e5b0 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -9296,7 +9296,8 @@ simplify_comparison (code, pop0, pop1)
}
/* (unsigned) < 0x80000000 is equivalent to >= 0. */
- else if (const_op == (HOST_WIDE_INT) 1 << (mode_width - 1))
+ else if ((mode_width <= HOST_BITS_PER_WIDE_INT)
+ && (const_op == (HOST_WIDE_INT) 1 << (mode_width - 1)))
{
const_op = 0, op1 = const0_rtx;
code = GE;
@@ -9311,7 +9312,8 @@ simplify_comparison (code, pop0, pop1)
code = EQ;
/* (unsigned) <= 0x7fffffff is equivalent to >= 0. */
- else if (const_op == ((HOST_WIDE_INT) 1 << (mode_width - 1)) - 1)
+ else if ((mode_width <= HOST_BITS_PER_WIDE_INT)
+ && (const_op == ((HOST_WIDE_INT) 1 << (mode_width - 1)) - 1))
{
const_op = 0, op1 = const0_rtx;
code = GE;
@@ -9329,7 +9331,8 @@ simplify_comparison (code, pop0, pop1)
}
/* (unsigned) >= 0x80000000 is equivalent to < 0. */
- else if (const_op == (HOST_WIDE_INT) 1 << (mode_width - 1))
+ else if ((mode_width <= HOST_BITS_PER_WIDE_INT)
+ && (const_op == (HOST_WIDE_INT) 1 << (mode_width - 1)))
{
const_op = 0, op1 = const0_rtx;
code = LT;
@@ -9344,7 +9347,8 @@ simplify_comparison (code, pop0, pop1)
code = NE;
/* (unsigned) > 0x7fffffff is equivalent to < 0. */
- else if (const_op == ((HOST_WIDE_INT) 1 << (mode_width - 1)) - 1)
+ else if ((mode_width <= HOST_BITS_PER_WIDE_INT)
+ && (const_op == ((HOST_WIDE_INT) 1 << (mode_width - 1)) - 1))
{
const_op = 0, op1 = const0_rtx;
code = LT;