]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR other/61391 (ICE in execute_one_pass at -O3 and above)
authorYuri Rumyantsev <ysrumyan@gmail.com>
Thu, 5 Jun 2014 10:24:22 +0000 (10:24 +0000)
committerKirill Yukhin <kyukhin@gcc.gnu.org>
Thu, 5 Jun 2014 10:24:22 +0000 (10:24 +0000)
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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr61391.c [new file with mode: 0644]
gcc/tree-if-conv.c

index 3366197ff5d451779376d63ed9dd8b5d6618a5b0..98d56a5ceedeaefe4ad9495c91be753967534878 100644 (file)
@@ -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
index 8ec6b5ebf5304bec94c5a63fb4565d6ac7e495cf..c43536ff977bf09cc07d1c9163b20eb1186efd95 100644 (file)
@@ -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 (file)
index 0000000..45b6c71
--- /dev/null
@@ -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]);
+  }
+}
index 69f1e1f06150de5496b6f69af25a200a52103911..6e298d328aa6dad2dfb15d3a5a1e4ce625f8a1e8 100644 (file)
@@ -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;