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]

Re: [PR debug/47106] account used vars only once


> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47788

The problem is that we now inline extern inlines at -O0, while previously we
didn't.  For some reason only LTO tests check this.

Since GCC 3.4 or so C frontend (but not C++) declare extern inlines
always_inline by setting DECl_DISREGARD_INLINE_LIMITS.  However the functions
are not inlined at -O0 because tree_inlinable_function_p returns false there.
It checks for always_inline attribute but ignores disregard_inline_limits.

tree_inlinable_function_p is not really good place to handle this, but we will
clean this up for 4.7.  This patch restores the previous behaviour

I am testing it x86_64-linux (this time with LTO) and will commit it once
testing passes.

Honza

Index: ipa-inline.c
===================================================================
--- ipa-inline.c	(revision 170249)
+++ ipa-inline.c	(working copy)
@@ -1990,6 +1990,8 @@ compute_inline_parameters (struct cgraph
 
   /* Can this function be inlined at all?  */
   node->local.inlinable = tree_inlinable_function_p (node->decl);
+  if (!node->local.inlinable)
+    node->local.disregard_inline_limits = 0;
 
   /* Inlinable functions always can change signature.  */
   if (node->local.inlinable)


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