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
This commit is contained in:
Jakub Jelinek 2005-02-18 00:50:02 +01:00 committed by Jakub Jelinek
parent c8d3e15a95
commit 5820359990
6 changed files with 43 additions and 0 deletions

View File

@ -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,

View File

@ -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);

View File

@ -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

View File

@ -0,0 +1,4 @@
/* PR tree-optimization/18947 */
extern __inline void f1 (void) { }
extern __inline void f2 (void) { f1 (); }
void f2 (void) {}

View File

@ -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 (); }

View File

@ -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 (); }