[Bug debug/59515] -Og doesn't generate out-of-line copies of inline functions like -O0 does
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Dec 19 13:18:00 GMT 2013
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59515
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2013-12-19
CC| |hubicka at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org
Ever confirmed|0 |1
Severity|normal |enhancement
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Thanks for the report - I agree that -Og should preserve an OOL copy of inlined
functions. I'll see what I can do here (with C++ and a lot of abstraction
penalty the code size impact of that could be quite big though, and via that
also the compile-time increase). We definitely need to avoid inlining into the
unused offline copy - but usually that's too late because we inline from the
leafs - if we don't the code-size impact is exponential ... :/
Honza, is there a way to do this in a clean way? That is, create a clone
of all initially reachable functions that we don't inline into, but remove
the clone if the original function prevails? That is, for
inline int bar () { return 42; }
inline int foo () { return bar() + bar(); }
int main()
{
return foo ();
}
have main return 84 but offline copies of bar and foo while foo should still
call bar twice?
Not sure if the exponential size consideration matters for -Og which
inlines for size improvements only.
More information about the Gcc-bugs
mailing list