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
This commit is contained in:
Richard Sandiford 2014-09-07 08:54:49 +00:00 committed by Richard Sandiford
parent ba6c79fc30
commit 9d31ea5b56
4 changed files with 37 additions and 4 deletions

View File

@ -1,3 +1,9 @@
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>
* config/arc/arc.c (arc_print_operand): Fix format for HOST_WIDE_INT.

View File

@ -4480,16 +4480,16 @@ simplify_relational_operation_1 (enum rtx_code code, enum machine_mode mode,
&& op0code == XOR
&& rtx_equal_p (XEXP (op0, 0), op1)
&& !side_effects_p (XEXP (op0, 0)))
return simplify_gen_relational (code, mode, cmp_mode,
XEXP (op0, 1), const0_rtx);
return simplify_gen_relational (code, mode, cmp_mode, XEXP (op0, 1),
CONST0_RTX (mode));
/* Likewise (eq/ne (xor x y) y) simplifies to (eq/ne x 0). */
if ((code == EQ || code == NE)
&& op0code == XOR
&& rtx_equal_p (XEXP (op0, 1), op1)
&& !side_effects_p (XEXP (op0, 1)))
return simplify_gen_relational (code, mode, cmp_mode,
XEXP (op0, 0), const0_rtx);
return simplify_gen_relational (code, mode, cmp_mode, XEXP (op0, 0),
CONST0_RTX (mode));
/* (eq/ne (xor x C1) C2) simplifies to (eq/ne x (C1^C2)). */
if ((code == EQ || code == NE)

View File

@ -1,3 +1,7 @@
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>
PR testsuite/56194

View File

@ -0,0 +1,23 @@
/* { 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;
}