aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYuri Rumyantsev <ysrumyan@gmail.com>2014-06-05 10:24:22 +0000
committerKirill Yukhin <kyukhin@gcc.gnu.org>2014-06-05 10:24:22 +0000
commite12355efb750245dbf58be8b054f2ab360d53f9e (patch)
treed67f6880cc1ad781381c7f8dd4b6d1fd079b34cc /gcc
parent947ca6a0c89e475c5ca53cd2a6c291dafab3d5bc (diff)
downloadgcc-e12355efb750245dbf58be8b054f2ab360d53f9e.zip
gcc-e12355efb750245dbf58be8b054f2ab360d53f9e.tar.gz
gcc-e12355efb750245dbf58be8b054f2ab360d53f9e.tar.bz2
re PR other/61391 (ICE in execute_one_pass at -O3 and above)
2014-06-05 Yuri Rumyantsev <ysrumyan@gmail.com> gcc/ PR tree-optimization/61391 * tree-if-conv.c (is_cond_scalar_reduction): Add missed check that stmt belongs to loop. gcc/testsuite/ * gcc.dg/torture/pr61391.c: New test. From-SVN: r211263
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr61391.c18
-rw-r--r--gcc/tree-if-conv.c3
4 files changed, 31 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3366197..98d56a5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2014-06-05 Yuri Rumyantsev <ysrumyan@gmail.com>
+
+ PR tree-optimization/61319
+ * tree-if-conv.c (is_cond_scalar_reduction): Add missed check that
+ stmt belongs to loop.
+
2014-06-05 Richard Biener <rguenther@suse.de>
* gimplify.c (create_tmp_from_val): Remove is_formal parameter
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8ec6b5e..c43536f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-06-05 Yuri Rumyantsev <ysrumyan@gmail.com>
+
+ * gcc.dg/torture/pr61319.c: New test.
+
2014-06-05 Marek Polacek <polacek@redhat.com>
PR c/56724
diff --git a/gcc/testsuite/gcc.dg/torture/pr61391.c b/gcc/testsuite/gcc.dg/torture/pr61391.c
new file mode 100644
index 0000000..45b6c71
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr61391.c
@@ -0,0 +1,18 @@
+/* { dg-do compile } */
+
+short int u;
+int h;
+int i;
+
+void
+p(void)
+{
+ int c[2] = { 0 };
+ for (h = 0; h < 2; ++h) {
+ static int *l = &h;
+ int t;
+ int n;
+ for (t = 0; t < 7; ++t)
+ c[0] = (i & -(short int)(c[h+1] || (u = -(n != *l))) || c[h+1]);
+ }
+}
diff --git a/gcc/tree-if-conv.c b/gcc/tree-if-conv.c
index 69f1e1f..6e298d3 100644
--- a/gcc/tree-if-conv.c
+++ b/gcc/tree-if-conv.c
@@ -1439,6 +1439,9 @@ is_cond_scalar_reduction (gimple phi, gimple *reduc,
|| gimple_has_volatile_ops (stmt))
return false;
+ if (!flow_bb_inside_loop_p (loop, gimple_bb (stmt)))
+ return false;
+
if (!is_predicated (gimple_bb (stmt)))
return false;