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]

[pretty-ipa] make functions declared inline always available


Hi,
at the moment GCC is conservative on optimizing across extern inline
functions and inline functions that are externally visible in PIC
expecting that function can be replaced by function of other semantics
at (dynamic) linktime.
This is overly conservative as both C++ and C99 require inline functions
to match and it does not make much sense to support this as no one knows
if function was inlined, not inlined or inlined somewhere.

Bootstrapped/regtested and applied to pretty-ipa

Index: cgraph.c
===================================================================
--- cgraph.c	(revision 141893)
+++ cgraph.c	(working copy)
@@ -1432,6 +1432,11 @@ cgraph_function_body_availability (struc
     avail = AVAIL_LOCAL;
   else if (!node->local.externally_visible)
     avail = AVAIL_AVAILABLE;
+  /* Inline functions are safe to be analyzed even if their sybol can
+     be overwritten at runtime.  It is not meaningful to enfore any sane
+     behaviour on replacing inline function by different body.  */
+  else if (DECL_DECLARED_INLINE_P (node->decl))
+    avail = AVAIL_AVAILABLE;
 
   /* If the function can be overwritten, return OVERWRITABLE.  Take
      care at least of two notable extensions - the COMDAT functions


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