aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2014-09-07 08:54:49 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2014-09-07 08:54:49 +0000
commit9d31ea5b56b8d101435315814039876457a8691b (patch)
treef0f5e8b0a3fdb2fc36e7ffa174ab9682d07467dc /gcc
parentba6c79fc30a1b70ddcf530b2a1eda5b1aabe1129 (diff)
downloadgcc-9d31ea5b56b8d101435315814039876457a8691b.zip
gcc-9d31ea5b56b8d101435315814039876457a8691b.tar.gz
gcc-9d31ea5b56b8d101435315814039876457a8691b.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/simplify-rtx.c8
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/i386/pr62208.c23
4 files changed, 37 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3596380..e32812c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 9478b3c..32df80d 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -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)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index dac1507..084c0d1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
diff --git a/gcc/testsuite/gcc.target/i386/pr62208.c b/gcc/testsuite/gcc.target/i386/pr62208.c
new file mode 100644
index 0000000..1fc9733
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr62208.c
@@ -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;
+}