This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/51680] [4.7 Regression] g++ 4.7 fails to inline trivial template stuff
- From: "hubicka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 07 Jan 2012 16:11:50 +0000
- Subject: [Bug tree-optimization/51680] [4.7 Regression] g++ 4.7 fails to inline trivial template stuff
- Auto-submitted: auto-generated
- References: <bug-51680-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51680
--- Comment #11 from Jan Hubicka <hubicka at gcc dot gnu.org> 2012-01-07 16:11:50 UTC ---
Well, the problem here is that we compile with -O2 and function is not declared
inline. Conequetely GCC inlines only when it thinks code size will shrink.
Inliner always works one step at a time and it does not know that inlining
process_fun_at is important to inline to inline add.
We now have estimate_edge_devirt_benefit that I fixed last week to also notice
indirect calls like this one. Unfortunately it is still not enough, since
inliner won't get past the idea that replacing a call by two calls is
increasing code size.
For 4.8 I plan to include logic that allows to bypass the limits when inlining
is known to be profitable, but I don't see much to do in 4.7 timeframe. 4.6
early inlined it more due to accounting bug.
Honza