This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
- From: "jamborm at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 Jul 2008 17:52:00 -0000
- Subject: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
- References: <bug-9079-4639@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #19 from jamborm at gcc dot gnu dot org 2008-07-25 17:51 -------
As of revision 138092 we are handling this much better.
The example in bug description gets inlined at -O2 even with
-fno-early-inlining.
The example in comment #10 does not work as expected yet. The new
edge is discovered but the always_inline attribute is disregarded and
the inlined does not decide to inline it on its own. I will try to
fix this but it should be noted that few guarantees can be made about
indirect calls to always_inline functions and about always_inline
functions which have their addresses taken in general.
As far as the third example in comment #11 is concerned, the only
problem is loading the target function from the array. The loaded
value is not recognized to be constant early enough to be considered
for inlining. That is really a separate issue though, quite different
from the one originally described. I will have a look at what we can
do earlier but I will close the bug if this is the only outstanding
issue and I don't see an easy fix.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079