Fix gcc.dg/attr-alwaysinline.c

Jan Hubicka jh@suse.cz
Thu May 11 16:44:00 GMT 2006


Hi,
this is regression introduced by my earlier patch to avoid unused static
functions to be optimized out.

Sorry for that, I must've missed the regression in my testing originally.

Also perhaps little discussion should go into whether we want the normal
inline functions to be output and what to do about static variables.  At
the moment we force all inline functions to be output and we optimize
out all unused statics at -O0 (we didn't do that in pre-cgraph world).
Both cases are easy to fix if there is reason for doing so.  (in fact I
already tested patch).

Boostrapped/regtested i686-pc-gnu-linux, will commit it shortly.

Honza

2006-05-11  Jan Hubicka  <jh@suse.cz>
	* cgraphunit.c (decide_is_function_needed): Don't force always_inline
	to be output at -O0.
Index: cgraphunit.c
===================================================================
*** cgraphunit.c	(revision 113653)
--- cgraphunit.c	(working copy)
*************** decide_is_function_needed (struct cgraph
*** 219,227 ****
       COMDAT functions that must be output only when they are needed. 
  
       When not optimizing, also output the static functions. (see
!      PR25962)
       */
!   if (((TREE_PUBLIC (decl) || !optimize) && !flag_whole_program)
        && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
      return true;
  
--- 223,233 ----
       COMDAT functions that must be output only when they are needed. 
  
       When not optimizing, also output the static functions. (see
!      PR25962), but don't do so for always_inline functions.
       */
!   if (((TREE_PUBLIC (decl)
! 	|| (!optimize && !node->local.disregard_inline_limits))
!       && !flag_whole_program)
        && !DECL_COMDAT (decl) && !DECL_EXTERNAL (decl))
      return true;
  



More information about the Gcc-patches mailing list