aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2016-05-09 12:23:11 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2016-05-09 12:23:11 +0000
commit171f6f05db326f704e48375045aa2a98ea77675c (patch)
tree0520193e0191c858a916d9aa1aabaffe7805dddb
parent23694dbb2aac1a1af06ea8e38aaba9c83842c079 (diff)
downloadgcc-171f6f05db326f704e48375045aa2a98ea77675c.zip
gcc-171f6f05db326f704e48375045aa2a98ea77675c.tar.gz
gcc-171f6f05db326f704e48375045aa2a98ea77675c.tar.bz2
re PR tree-optimization/70985 (ICE on valid code at -O3 on x86_64-linux-gnu: verify_gimple failed)
2016-05-09 Richard Biener <rguenther@suse.de> PR tree-optimization/70985 * match.pd (BIT_FIELD_REF -> (type)): Disable on GIMPLE when op0 isn't a gimple register. * gcc.dg/torture/pr70985.c: New testcase. From-SVN: r236032
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/match.pd2
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr70985.c28
4 files changed, 41 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d61ec18..c303b94 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-05-09 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70985
+ * match.pd (BIT_FIELD_REF -> (type)): Disable on GIMPLE when
+ op0 isn't a gimple register.
+
2016-05-09 Prachi Godbole <prachi.godbole@imgtec.com>
* config/mips/i6400.md (i6400_fpu_intadd, i6400_fpu_logic)
diff --git a/gcc/match.pd b/gcc/match.pd
index 55dd23c..e511e9a 100644
--- a/gcc/match.pd
+++ b/gcc/match.pd
@@ -3244,6 +3244,8 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)
(view_convert (imagpart @0)))))
(if (INTEGRAL_TYPE_P (TREE_TYPE (@0))
&& INTEGRAL_TYPE_P (type)
+ /* On GIMPLE this should only apply to register arguments. */
+ && (! GIMPLE || is_gimple_reg (@0))
/* A bit-field-ref that referenced the full argument can be stripped. */
&& ((compare_tree_int (@1, TYPE_PRECISION (TREE_TYPE (@0))) == 0
&& integer_zerop (@2))
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index bcb75c4..9e97454 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-09 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/70985
+ * gcc.dg/torture/pr70985.c: New testcase.
+
2016-05-09 Bin Cheng <bin.cheng@arm.com>
* gcc.dg/tree-ssa/ifc-9.c: New test.
diff --git a/gcc/testsuite/gcc.dg/torture/pr70985.c b/gcc/testsuite/gcc.dg/torture/pr70985.c
new file mode 100644
index 0000000..17273b0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr70985.c
@@ -0,0 +1,28 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target int32plus } */
+
+struct
+{
+ int f0:24;
+} a, c, d;
+
+int b;
+
+int
+fn1 ()
+{
+ return 0;
+}
+
+void
+fn2 ()
+{
+ int e;
+ if (b)
+ for (; e;)
+ {
+ d = c;
+ if (fn1 (b))
+ b = a.f0;
+ }
+}