aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-split.c4
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/g++.dg/opt/pr45412.C26
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr44937.c30
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr45412.c22
6 files changed, 94 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fc2ceb1..8c38f68 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2010-09-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44937
+ PR tree-optimization/45412
+ * ipa-split.c (split_function): Properly remove PHI nodes.
+
2010-09-02 Joseph Myers <joseph@codesourcery.com>
* opts.h (struct cl_option): Add warn_message field.
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 712fbf5..56f689b 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -993,8 +993,8 @@ split_function (struct split_point *split_point)
{
gimple stmt = gsi_stmt (gsi);
gcc_assert (!is_gimple_reg (gimple_phi_result (stmt)));
- mark_sym_for_renaming (SSA_NAME_VAR (PHI_RESULT (stmt)));
- gsi_remove (&gsi, false);
+ mark_virtual_phi_result_for_renaming (stmt);
+ remove_phi_node (&gsi, true);
}
}
/* When we pass aorund the value, use existing return block. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 83c17e4..1c1608f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2010-09-02 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44937
+ PR tree-optimization/45412
+ * g++.dg/opt/pr45412.C: New testcase.
+ * gcc.c-torture/compile/pr45412.c: Likewise.
+ * gcc.c-torture/compile/pr44937.c: Likewise.
+
2010-09-02 Joseph Myers <joseph@codesourcery.com>
* gcc.dg/cpp/warn-comments-3.c: New. Based on warn-comments-2.c
diff --git a/gcc/testsuite/g++.dg/opt/pr45412.C b/gcc/testsuite/g++.dg/opt/pr45412.C
new file mode 100644
index 0000000..e374f52
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr45412.C
@@ -0,0 +1,26 @@
+// { dg-do compile }
+// { dg-options "-O2 -fipa-cp-clone -ftracer" }
+
+int foo (int *);
+void bar ();
+
+struct S
+{
+ virtual int vm ();
+ ~S ();
+};
+
+int
+S::vm ()
+{
+ int state;
+ switch (foo (&state))
+ {
+ case 0:
+ bar ();
+ case 1:
+ delete this;
+ }
+ return state;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44937.c b/gcc/testsuite/gcc.c-torture/compile/pr44937.c
new file mode 100644
index 0000000..3bb711d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44937.c
@@ -0,0 +1,30 @@
+int g_19;
+int *g_42;
+int **volatile g = &g_42;
+int g_67[5][9][2][1] = {
+};
+
+int
+func_4 (int p_5, unsigned char p_6, unsigned char p_7)
+{
+ unsigned char l_8[1];
+ if (p_6)
+ goto lbl_13;
+ for (p_6 = 0; p_6; p_6 = (p_6, 0))
+ if (0)
+ {
+ }
+ else
+ lbl_13:for (p_6 = 0; p_6 < 1; p_6 += 1)
+ l_8[p_6] = 0;
+ return 0;
+}
+
+int *
+func_45 (unsigned long p_46, unsigned char p_47)
+{
+ int *l_56 = &g_19;
+ (void *)&l_56 != (void *)&g | !1 == func_4 (0, g_67[2][6][1][0], 0) ^ func_4 (1, 0, 0);
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr45412.c b/gcc/testsuite/gcc.c-torture/compile/pr45412.c
new file mode 100644
index 0000000..339854b
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr45412.c
@@ -0,0 +1,22 @@
+extern void baz (int, int, int);
+
+int j;
+
+int
+bar (void)
+{
+ int n = 0, *np = &n;
+ if (j)
+ baz (0, 0, 0);
+ if (j)
+ baz (0, 0, 0);
+ return n;
+}
+
+void
+foo (void)
+{
+ bar ();
+ bar ();
+}
+