Commit 9d31ea5b by Richard Sandiford Committed by Richard Sandiford

re PR rtl-optimization/62208 (ICE with -fwhole-program on valid code at -O3 on…

re PR rtl-optimization/62208 (ICE with -fwhole-program on valid code at -O3 on x86_64-linux-gnu in trunc_int_for_mode, at explow.c:56)

gcc/
	PR rtl-optimization/62208
	* simplify-rtx.c (simplify_relational_operation_1): Use CONST0_RTX
	rather than const0_rtx in eq/ne-xor simplifications.

gcc/testsuite/
	* gcc.target/i386/pr62208.c: New test.

From-SVN: r215002
parent ba6c79fc
2014-09-07 Richard Sandiford <rdsandiford@googlemail.com>
PR rtl-optimization/62208
* simplify-rtx.c (simplify_relational_operation_1): Use CONST0_RTX
rather than const0_rtx in eq/ne-xor simplifications.
2014-09-06 Joern Rennecke <joern.rennecke@embecosm.com> 2014-09-06 Joern Rennecke <joern.rennecke@embecosm.com>
* config/arc/arc.c (arc_print_operand): Fix format for HOST_WIDE_INT. * config/arc/arc.c (arc_print_operand): Fix format for HOST_WIDE_INT.
...@@ -4480,16 +4480,16 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode, ...@@ -4480,16 +4480,16 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
&& op0code == XOR && op0code == XOR
&& rtx_equal_p (XEXP (op0, 0), op1) && rtx_equal_p (XEXP (op0, 0), op1)
&& !side_effects_p (XEXP (op0, 0))) && !side_effects_p (XEXP (op0, 0)))
return simplify_gen_relational (code, mode, cmp_mode, return simplify_gen_relational (code, mode, cmp_mode, XEXP (op0, 1),
XEXP (op0, 1), const0_rtx); CONST0_RTX (mode));
/* Likewise (eq/ne (xor x y) y) simplifies to (eq/ne x 0). */ /* Likewise (eq/ne (xor x y) y) simplifies to (eq/ne x 0). */
if ((code == EQ || code == NE) if ((code == EQ || code == NE)
&& op0code == XOR && op0code == XOR
&& rtx_equal_p (XEXP (op0, 1), op1) && rtx_equal_p (XEXP (op0, 1), op1)
&& !side_effects_p (XEXP (op0, 1))) && !side_effects_p (XEXP (op0, 1)))
return simplify_gen_relational (code, mode, cmp_mode, return simplify_gen_relational (code, mode, cmp_mode, XEXP (op0, 0),
XEXP (op0, 0), const0_rtx); CONST0_RTX (mode));
/* (eq/ne (xor x C1) C2) simplifies to (eq/ne x (C1^C2)). */ /* (eq/ne (xor x C1) C2) simplifies to (eq/ne x (C1^C2)). */
if ((code == EQ || code == NE) if ((code == EQ || code == NE)
......
2014-09-07 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.target/i386/pr62208.c: New test.
2014-09-06 John David Anglin <danglin@gcc.gnu.org> 2014-09-06 John David Anglin <danglin@gcc.gnu.org>
PR testsuite/56194 PR testsuite/56194
......
/* { dg-options "-O3 -fwhole-program -march=x86-64" } */
int *a;
unsigned int b;
void fn2 ()
{
int t[9];
for (; b; b++)
*a ^= (~t[b] != t[b]);
}
int fn1 ()
{
fn2 ();
return 0;
}
int main ()
{
fn1 ();
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