re PR c++/6352 (GCC 3.1 inliner regression from March)

PR c++/6352
	* toplev.c (rest_of_compilation): Do not defer functions for which
	TREE_SYMBOL_REFERENCED has already been set.

	* PR6352
	* g++.dg/opt/inline2.C: New test.

From-SVN: r52521
This commit is contained in:
Mark Mitchell 2002-04-19 16:21:58 +00:00 committed by Mark Mitchell
parent de80110b88
commit 303a3927d2
4 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2002-04-19 Mark Mitchell <mark@codesourcery.com>
PR c++/6352
* toplev.c (rest_of_compilation): Do not defer functions for which
TREE_SYMBOL_REFERENCED has already been set.
Fri Apr 19 15:53:03 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.md (movsi_1, movhi_1): Force reload to use more flexible

View File

@ -1,3 +1,8 @@
2002-04-19 Mark Mitchell <mark@codesourcery.com>
* PR6352
* g++.dg/opt/inline2.C: New test.
2002-04-18 Richard Henderson <rth@redhat.com>
* gcc.dg/20000906-1.c: Enable for all targets.

View File

@ -0,0 +1,18 @@
// { dg-do link }
// { dg-options "-O1 -finline-functions" }
static void g ();
void f()
{
void g();
g();
}
void g()
{
}
int main () {
f ();
}

View File

@ -2374,6 +2374,7 @@ rest_of_compilation (decl)
if (inlinable
|| (DECL_INLINE (decl)
&& ((! TREE_PUBLIC (decl) && ! TREE_ADDRESSABLE (decl)
&& ! TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
&& ! flag_keep_inline_functions)
|| DECL_EXTERNAL (decl))))
DECL_DEFER_OUTPUT (decl) = 1;