aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-02-18 00:50:02 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2005-02-18 00:50:02 +0100
commit582035999026399da5ccc2d10d8e0a7691040251 (patch)
treec8d718fc6dcc552bb2e503ca60d1d787e1f0197b /gcc
parentc8d3e15a95f73a50e02c226b52bd9e9c5060120e (diff)
downloadgcc-582035999026399da5ccc2d10d8e0a7691040251.zip
gcc-582035999026399da5ccc2d10d8e0a7691040251.tar.gz
gcc-582035999026399da5ccc2d10d8e0a7691040251.tar.bz2
re PR tree-optimization/18947 ([non-UAAT] external inline and normal function of the same name)
PR tree-optimization/18947 * cgraphunit.c (cgraph_finalize_function): When redefining an extern inline, remove all nodes that are inlined into the extern inline being redefined. * gcc.c-torture/compile/20050215-1.c: New test. * gcc.c-torture/compile/20050215-2.c: New test. * gcc.c-torture/compile/20050215-3.c: New test. From-SVN: r95207
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cgraphunit.c10
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20050215-1.c4
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20050215-2.c7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20050215-3.c8
6 files changed, 43 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 4bc7961..610d47a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/18947
+ * cgraphunit.c (cgraph_finalize_function): When redefining an extern
+ inline, remove all nodes that are inlined into the extern inline
+ being redefined.
+
2005-02-17 Kazu Hirata <kazu@cs.umass.edu>
* bt-load.c, cfgloop.c, convert.c, dominance.c, global.c,
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 22b3381..b993160 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -346,6 +346,16 @@ cgraph_finalize_function (tree decl, bool nested)
memset (&node->rtl, 0, sizeof (node->rtl));
node->analyzed = false;
node->local.redefined_extern_inline = true;
+
+ if (!flag_unit_at_a_time)
+ {
+ struct cgraph_node *n;
+
+ for (n = cgraph_nodes; n; n = n->next)
+ if (n->global.inlined_to == node)
+ cgraph_remove_node (n);
+ }
+
while (node->callees)
cgraph_remove_edge (node->callees);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d03c81f..ccfd4ef 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/18947
+ * gcc.c-torture/compile/20050215-1.c: New test.
+ * gcc.c-torture/compile/20050215-2.c: New test.
+ * gcc.c-torture/compile/20050215-3.c: New test.
+
2005-02-17 Alexandre Oliva <aoliva@redhat.com>
PR c++/20028
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050215-1.c b/gcc/testsuite/gcc.c-torture/compile/20050215-1.c
new file mode 100644
index 0000000..e971779
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20050215-1.c
@@ -0,0 +1,4 @@
+/* PR tree-optimization/18947 */
+extern __inline void f1 (void) { }
+extern __inline void f2 (void) { f1 (); }
+void f2 (void) {}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050215-2.c b/gcc/testsuite/gcc.c-torture/compile/20050215-2.c
new file mode 100644
index 0000000..44550d0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20050215-2.c
@@ -0,0 +1,7 @@
+/* PR tree-optimization/18947 */
+int v;
+extern __inline void f1 (void) { v++; }
+void f4 (void) { f1 (); }
+extern __inline void f2 (void) { f1 (); }
+void f3 (void) { f2 (); }
+void f2 (void) { f1 (); }
diff --git a/gcc/testsuite/gcc.c-torture/compile/20050215-3.c b/gcc/testsuite/gcc.c-torture/compile/20050215-3.c
new file mode 100644
index 0000000..7a35eb6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20050215-3.c
@@ -0,0 +1,8 @@
+/* PR tree-optimization/18947 */
+int v;
+extern __inline void f0 (void) { v++; }
+extern __inline void f1 (void) { f0 (); }
+void f4 (void) { f1 (); }
+extern __inline void f2 (void) { f1 (); }
+void f3 (void) { f2 (); }
+void f2 (void) { f1 (); }