This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[commited] Fix deferring of functions
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 11 Oct 2003 19:44:25 +0200
- Subject: [commited] Fix deferring of functions
Hi,
the test in decide_is_function_needed is other way around, so we deffer
functions not declared as inline but marked as inline because of -O3 and
still being uninlinable.
This incovered another problem C++ fronted that marks function
DECL_INLINE to avoid it from being emit when not needed, but we need
DECL_DECLARED_INLINE_P. This however makes it to come into gnulinkonce
instead of being static, DECL_INTERFACE_KNOWN avoids that.
Tested on i386 and going to install it as obivous.
Honza
Sat Oct 11 15:39:11 CEST 2003 Jan Hubicka <jh@suse.cz>
* cgraphunit.c (decide_is_function_needed): Fix test dealing
with functions implicitly made inline.
* decl.c (start_cleanup_fn): Set DECL_DECLARED_INLINE_P to deffer
the expansion.
*** gcc.old/cgraphunit.c Sat Sep 27 23:30:30 2003
--- gcc/cgraphunit.c Sat Oct 11 13:38:34 2003
*************** decide_is_function_needed (struct cgraph
*** 114,120 ****
/* When declared inline, defer even the uninlinable functions.
This allows them to be elliminated when unused. */
&& !DECL_DECLARED_INLINE_P (decl)
! && (node->local.inlinable || !cgraph_default_inline_p (node))))
return true;
return false;
--- 118,124 ----
/* When declared inline, defer even the uninlinable functions.
This allows them to be elliminated when unused. */
&& !DECL_DECLARED_INLINE_P (decl)
! && (!node->local.inlinable || !cgraph_default_inline_p (node))))
return true;
return false;
diff -rc3p gcc.old/cp/decl.c gcc/cp/decl.c
*** gcc.old/cp/decl.c Sat Sep 27 23:30:13 2003
--- gcc/cp/decl.c Sat Oct 11 15:28:09 2003
*************** start_cleanup_fn (void)
*** 8301,8306 ****
--- 8303,8310 ----
it is only called via a function pointer, but we avoid unnecessary
emissions this way. */
DECL_INLINE (fndecl) = 1;
+ DECL_DECLARED_INLINE_P (fndecl) = 1;
+ DECL_INTERFACE_KNOWN (fndecl) = 1;
/* Build the parameter. */
if (flag_use_cxa_atexit)
{