https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67307
Bug ID: 67307 Summary: FE considers 'inline int foo ()' as always-inline, inlining not disabled via -fno-early-inlining Product: gcc Version: 6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org CC: hubicka at gcc dot gnu.org, jsm28 at gcc dot gnu.org Target Milestone: --- inline int foo (int i) { return i; } runs into c-decl.c /* For GNU C extern inline functions disregard inline limits. */ if (DECL_EXTERNAL (fndecl) && DECL_DECLARED_INLINE_P (fndecl)) DECL_DISREGARD_INLINE_LIMITS (fndecl) = 1; but not with -std=gnu89, only with -std=gnu99. This means it is considered "always-inline" by inline_always_inline_functions which means it is still inlined early even with -fno-early-inlining. Not sure if the FE behavior is desired - we have DECL_DECLARED_INLINE_P to guide general inlining. DECL_DISREGARD_INLINE_LIMITS should really be only used if "always-inline" semantics are to be wanted by the FE.