OSDN Git Service

2012-01-20 Richard Guenther <rguenther@suse.de>
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jan 2012 10:10:46 +0000 (10:10 +0000)
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 20 Jan 2012 10:10:46 +0000 (10:10 +0000)
PR tree-optimization/51903
* tree-ssa-pre.c (eliminate): Properly purging of EH edges
when removing stmts.

* g++.dg/torture/pr51903.C: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@183329 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/torture/pr51903.C [new file with mode: 0644]
gcc/tree-ssa-pre.c

index 4e35838..030bedb 100644 (file)
@@ -1,3 +1,9 @@
+2012-01-20  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/51903
+       * tree-ssa-pre.c (eliminate): Properly purging of EH edges
+       when removing stmts.
+
 2012-01-20  Ramana Radhakrishnan  <ramana.radhakrishnan@linaro.org>
 
        PR target/50313
index 2d42abf..0a726fc 100644 (file)
@@ -1,3 +1,8 @@
+2012-01-20  Richard Guenther  <rguenther@suse.de>
+
+       PR tree-optimization/51903
+       * g++.dg/torture/pr51903.C: New testcase.
+
 2012-01-20  Tobias Burnus  <burnus@net-b.de>
            Janus Weil  <janus@gcc.gnu.org>
 
diff --git a/gcc/testsuite/g++.dg/torture/pr51903.C b/gcc/testsuite/g++.dg/torture/pr51903.C
new file mode 100644 (file)
index 0000000..925021b
--- /dev/null
@@ -0,0 +1,9 @@
+// { dg-do compile }
+// { dg-options "-O2 -fnon-call-exceptions -fno-guess-branch-probability" }
+
+#include <vector>
+
+void foo ()
+{
+  std::vector < std::vector< int > > (20000);
+}
index c5d253c..b95ac78 100644 (file)
@@ -4541,8 +4541,10 @@ eliminate (void)
          gsi = gsi_for_stmt (stmt);
          unlink_stmt_vdef (stmt);
          gsi_remove (&gsi, true);
-         if (gimple_purge_dead_eh_edges (bb))
-           todo |= TODO_cleanup_cfg;
+         /* ???  gsi_remove doesn't tell us whether the stmt was
+            in EH tables and thus whether we need to purge EH edges.
+            Simply schedule the block for a cleanup.  */
+         bitmap_set_bit (need_eh_cleanup, bb->index);
          if (TREE_CODE (lhs) == SSA_NAME)
            bitmap_clear_bit (inserted_exprs, SSA_NAME_VERSION (lhs));
          release_defs (stmt);