OSDN Git Service

gcc/
authorsteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Dec 2010 15:02:02 +0000 (15:02 +0000)
committersteven <steven@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 21 Dec 2010 15:02:02 +0000 (15:02 +0000)
PR middle-end/45310
* tree-ssa-phiprop.c (propagate_with_phi): Remove statement
completely from the function, including EH traces.

testsuite/
PR middle-end/45310
* g++.dg/pr45310.C: New test.

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

gcc/testsuite/g++.dg/pr45310.C [new file with mode: 0644]
gcc/tree-ssa-phiprop.c

diff --git a/gcc/testsuite/g++.dg/pr45310.C b/gcc/testsuite/g++.dg/pr45310.C
new file mode 100644 (file)
index 0000000..335c782
--- /dev/null
@@ -0,0 +1,31 @@
+/* { dg-do compile } */
+/* { dg-options "-O1 -fnon-call-exceptions" }  */
+
+static inline const int &
+max (const int &a, const int &b)
+{
+  return a ? a : b;
+}
+
+static inline int
+baz ()
+{
+  return max (0, 0);
+}
+
+struct S
+{
+  ~S ()
+  {
+    baz ();
+  }
+};
+
+void bar ();
+void
+foo ()
+{
+  S s;
+  bar ();
+}
+
index 614546b..a38e696 100644 (file)
@@ -352,7 +352,7 @@ propagate_with_phi (basic_block bb, gimple phi, struct phiprop_d *phivn,
             want to delete it here we also have to delete all intermediate
             copies.  */
          gsi = gsi_for_stmt (use_stmt);
-         gsi_remove (&gsi, false);
+         gsi_remove (&gsi, true);
 
          phi_inserted = true;
        }