Bug#173513: [Bug tree-optimization/9079] [tree-ssa] Inline constant function pointers
------- Comment #20 from jamborm at gcc dot gnu dot org 2008-10-22 15:09 -------
OK, here is the status regarding the trunk (4.4) and the test cases
posted here:
1. The test case in the bug description now works in the sense that
funk is inlined even when not performing early inlining because
both indirect inlining and copy propagation can help the inliner do
this.
2. When compiling the code from comment #10 with indirect inlining
turned on (default on -O2) we end up with (taken from the
"optimized" tree dump):
a (int x)
{
<bb 2>:
if (x != 0)
goto <bb 3>;
else
goto <bb 4>;
<bb 3>:
f (); [tail call]
goto <bb 5>;
<bb 4>:
f (); [tail call]
<bb 5>:
return;
}
Which obviously might be optimized even further but this is no
longer an inlining issue.
3. Finally, let's look at code from comment #11. The function main
still retains one call to foo(), specifically the one that came
from function call(). The reason is that early cpp does not see
the index being constant and thus does not replace the array_ref
directly with the constant. Arguments could be made that cpp
should be run few more times at various places (after ipa-cp, for
example) but IMHO pass ordering would need bigger justification
than this artificial example and this would be very difficult to
implement while also retaining the three phase division of ipa
passes for lto.
Because we are done with all three examples as far as inlining is
concerned, I think this is fixed.
--
jamborm at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9079
------- You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
Reply to: