summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1996-12-16 12:27:35 -0800
committerJim Wilson <wilson@gcc.gnu.org>1996-12-16 12:27:35 -0800
commitf77aada2b4f271fa84f68411e74847ea48e2f762 (patch)
tree2988a18be8f17b49ec7b16d803ebebbb45755b97
parent4246e0c55bf669cfa59fc68e6dedea70a6cabdbd (diff)
downloadgcc-f77aada2b4f271fa84f68411e74847ea48e2f762.tar.gz
(simplify_comparison): Use mode_width as shift count
only if it is less than or equal to HOST_BITS_PER_WIDE_INT. From-SVN: r13312
-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;