Commit 3e26c8f6 by Richard Sandiford Committed by Richard Sandiford

re PR rtl-optimization/61222 (ICE on valid code at -O2 and -O3 on…

re PR rtl-optimization/61222 (ICE on valid code at -O2 and -O3 on x86_64-linux-gnu in decompose, at rtl.h:1456)

gcc/
	PR rtl-optimization/61222
	* combine.c (simplify_shift_const_1): When moving a PLUS outside
	the shift, truncate the PLUS operand to the result mode.

gcc/testsuite/
	PR rtl-optimization/61222
	* gcc.c-torture/compile/pr61222-1.c: New test.
	* gcc.c-torture/compile/pr61222-2.c: Likewise.

From-SVN: r210945
parent cf0ff174
2014-05-26 Richard Sandiford <r.sandiford@uk.ibm.com>
PR rtl-optimization/61222
* combine.c (simplify_shift_const_1): When moving a PLUS outside
the shift, truncate the PLUS operand to the result mode.
2014-05-26 Uros Bizjak <ubizjak@gmail.com> 2014-05-26 Uros Bizjak <ubizjak@gmail.com>
PR target/61271 PR target/61271
......
...@@ -10349,9 +10349,10 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, ...@@ -10349,9 +10349,10 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
/* (ashift (plus foo C) N) is (plus (ashift foo N) C'). */ /* (ashift (plus foo C) N) is (plus (ashift foo N) C'). */
if (code == ASHIFT if (code == ASHIFT
&& CONST_INT_P (XEXP (varop, 1)) && CONST_INT_P (XEXP (varop, 1))
&& (new_rtx = simplify_const_binary_operation (ASHIFT, result_mode, && (new_rtx = simplify_const_binary_operation
XEXP (varop, 1), (ASHIFT, result_mode,
GEN_INT (count))) != 0 gen_int_mode (INTVAL (XEXP (varop, 1)), result_mode),
GEN_INT (count))) != 0
&& CONST_INT_P (new_rtx) && CONST_INT_P (new_rtx)
&& merge_outer_ops (&outer_op, &outer_const, PLUS, && merge_outer_ops (&outer_op, &outer_const, PLUS,
INTVAL (new_rtx), result_mode, &complement_p)) INTVAL (new_rtx), result_mode, &complement_p))
...@@ -10368,9 +10369,10 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode, ...@@ -10368,9 +10369,10 @@ simplify_shift_const_1 (enum rtx_code code, enum machine_mode result_mode,
if (code == LSHIFTRT if (code == LSHIFTRT
&& CONST_INT_P (XEXP (varop, 1)) && CONST_INT_P (XEXP (varop, 1))
&& mode_signbit_p (result_mode, XEXP (varop, 1)) && mode_signbit_p (result_mode, XEXP (varop, 1))
&& (new_rtx = simplify_const_binary_operation (code, result_mode, && (new_rtx = simplify_const_binary_operation
XEXP (varop, 1), (code, result_mode,
GEN_INT (count))) != 0 gen_int_mode (INTVAL (XEXP (varop, 1)), result_mode),
GEN_INT (count))) != 0
&& CONST_INT_P (new_rtx) && CONST_INT_P (new_rtx)
&& merge_outer_ops (&outer_op, &outer_const, XOR, && merge_outer_ops (&outer_op, &outer_const, XOR,
INTVAL (new_rtx), result_mode, &complement_p)) INTVAL (new_rtx), result_mode, &complement_p))
......
2014-05-26 Richard Sandiford <r.sandiford@uk.ibm.com>
PR rtl-optimization/61222
* gcc.c-torture/compile/pr61222-1.c: New test.
* gcc.c-torture/compile/pr61222-2.c: Likewise.
2014-05-26 Uros Bizjak <ubizjak@gmail.com> 2014-05-26 Uros Bizjak <ubizjak@gmail.com>
* c-c++-common/cilk-plus/AN/pr61191.c: Fix dg-error directives. * c-c++-common/cilk-plus/AN/pr61191.c: Fix dg-error directives.
......
int a, b, d, e;
char c;
void
foo ()
{
for (; a; a++)
{
d = ((b == 0) ^ (129 + a));
c = d * 9;
e = c < 1;
if (e)
for (;;)
;
}
}
int
main ()
{
foo ();
return 0;
}
int a, b, d;
int main (void)
{
int c = a && 1;
d = 1 << (((c | (b - 842)) << 1) + 1);
return 0;
}
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