Commit f77aada2 by Jim Wilson

(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
parent 4246e0c5
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment