]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
backport: re PR tree-optimization/47639 (ICE: verify_stmts failed: statement marked...
authorRichard Guenther <rguenther@suse.de>
Tue, 1 Mar 2011 17:06:41 +0000 (17:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Tue, 1 Mar 2011 17:06:41 +0000 (17:06 +0000)
2011-03-01  Richard Guenther  <rguenther@suse.de>

        Backport from mainline
        2011-02-08  Richard Guenther  <rguenther@suse.de>

PR middle-end/47639
* tree-vect-generic.c (expand_vector_operations_1): Update
stmts here ...
(expand_vector_operations): ... not here.  Cleanup EH info
and the CFG if required.

* g++.dg/opt/pr47639.c: New testcase.

From-SVN: r170596

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/opt/pr47639.c [new file with mode: 0644]
gcc/tree-vect-generic.c

index 2e8044800f9d41ea2de2188f2fb730386782bf2b..4a5e965cf615689e83fc4056fb7da99ff04f0c85 100644 (file)
@@ -1,3 +1,14 @@
+2011-03-01  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline
+       2011-02-08  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/47639
+       * tree-vect-generic.c (expand_vector_operations_1): Update
+       stmts here ...
+       (expand_vector_operations): ... not here.  Cleanup EH info
+       and the CFG if required.
+
 2011-03-01  Richard Guenther  <rguenther@suse.de>
 
        Backport from mainline
index 43b8604ec89497096a24f6fbe6e828145ff3f63f..4eea9c42ee91330020f8122a05373f2d6eb5109c 100644 (file)
@@ -1,3 +1,11 @@
+2011-03-01  Richard Guenther  <rguenther@suse.de>
+
+       Backport from mainline
+       2011-02-08  Richard Guenther  <rguenther@suse.de>
+
+       PR middle-end/47639
+       * g++.dg/opt/pr47639.c: New testcase.
+
 2011-03-01  Richard Guenther  <rguenther@suse.de>
 
        Backport from mainline
diff --git a/gcc/testsuite/g++.dg/opt/pr47639.c b/gcc/testsuite/g++.dg/opt/pr47639.c
new file mode 100644 (file)
index 0000000..6ee8bb7
--- /dev/null
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-fnon-call-exceptions" }
+
+typedef int __attribute__ ((vector_size (8))) vec;
+
+vec foo (vec v1, vec v2)
+{
+  try
+    {
+      return v1 / v2;
+    }
+  catch (...)
+    {
+      throw;
+    }
+}
+
index 2bb71a137abc0ab618743bb5334ff823e03fc3f1..6f64302ddb08d0a92b7a13c787f8fe1b67024678 100644 (file)
@@ -518,8 +518,7 @@ expand_vector_operations_1 (gimple_stmt_iterator *gsi)
      way to do it is change expand_vector_operation and its callees to
      return a tree_code, RHS1 and RHS2 instead of a tree. */
   gimple_assign_set_rhs_from_tree (gsi, new_rhs);
-
-  gimple_set_modified (gsi_stmt (*gsi), true);
+  update_stmt (gsi_stmt (*gsi));
 }
 \f
 /* Use this to lower vector operations introduced by the vectorizer,
@@ -536,16 +535,24 @@ expand_vector_operations (void)
 {
   gimple_stmt_iterator gsi;
   basic_block bb;
+  bool cfg_changed = false;
 
   FOR_EACH_BB (bb)
     {
       for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi))
        {
          expand_vector_operations_1 (&gsi);
-         update_stmt_if_modified (gsi_stmt (gsi));
+         /* ???  If we do not cleanup EH then we will ICE in
+            verification.  But in reality we have created wrong-code
+            as we did not properly transition EH info and edges to
+            the piecewise computations.  */
+         if (maybe_clean_eh_stmt (gsi_stmt (gsi))
+             && gimple_purge_dead_eh_edges (bb))
+           cfg_changed = true;
        }
     }
-  return 0;
+
+  return cfg_changed ? TODO_cleanup_cfg : 0;
 }
 
 struct gimple_opt_pass pass_lower_vector =