http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59626
--- Comment #19 from Richard Biener <rguenth at gcc dot gnu.org> --- Better patch - simply kill all bodies of extern always_inline functions before LTO streaming... (we should be able to do that anyway) Index: gcc/ipa.c =================================================================== --- gcc/ipa.c (revision 208745) +++ gcc/ipa.c (working copy) @@ -1218,6 +1218,29 @@ static unsigned free_inline_summary (void) { inline_free_summary (); + /* If we create LTO bytecode then drop bodies of extern always_inline + functions now. */ + if (flag_lto) + { + cgraph_node *node; + FOR_EACH_DEFINED_FUNCTION (node) + if (DECL_EXTERNAL (node->decl) + && lookup_attribute ("always_inline", + DECL_ATTRIBUTES (node->decl)) != NULL) + { + cgraph_release_function_body (node); + /* ??? The above doesn't do what I like it to do ;) */ + node->analyzed = false; + node->definition = false; + /* ??? Shouldn't be necessary but the diagnostic code doesn't + verify if there is a definition at all. + ??? Note attribute lists are possibly shared and + remove_attribute doesn't honor that. */ + DECL_ATTRIBUTES (node->decl) + = remove_attribute ("always_inline", + DECL_ATTRIBUTES (node->decl)); + } + } return 0; }