This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

-fkeep-inline-functions fix


Hi,
-fkeep-inline-functions is ignored now and was ignored at least since 4.1.
This patch restores the intended behaviour.

Bootstrapped/regtested i686-linux, will commit it tomorrow if there are no
complains.
/* { dg-do compile } */
/* { dg-options "-O2 -fkeep-inline-functions" } */
/* { dg-final { scan-assembler-not "xyzzy" } } */

static inline int xyzzy (int x) { return x; }

	* cgraphunit.c (decide_is_function_needed): Honor
	-fkeep-inline-functions.
Index: cgraphunit.c
===================================================================
*** cgraphunit.c	(revision 121950)
--- cgraphunit.c	(working copy)
*************** decide_is_function_needed (struct cgraph
*** 198,203 ****
--- 198,210 ----
        && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl)))
      return true;
  
+   /* With -fkeep-inline-functions we are keeping all inline functions except
+      for extern inline ones.  */
+   if (flag_keep_inline_functions
+       && DECL_DECLARED_INLINE_P (decl)
+       && !DECL_EXTERNAL (decl))
+      return true;
+ 
    /* If we decided it was needed before, but at the time we didn't have
       the body of the function available, then it's still needed.  We have
       to go back and re-check its dependencies now.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]