This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/30908] -Os inlines functions that are called more than once (optimization regression)
- From: "hubicka at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2007 17:26:59 -0000
- Subject: [Bug middle-end/30908] -Os inlines functions that are called more than once (optimization regression)
- References: <bug-30908-11199@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #9 from hubicka at gcc dot gnu dot org 2007-02-21 17:26 -------
The main problem here is that inliner really don't have enough of detailed
information. In general inlining improves optimization and often leads to
smaller code when inlining such a trivial function ARM or not. Clearly the
outcome depends on function, on the context it is called in and on the target
platform and on the other optimizations enabled but basically only function
body in very rought way is considered when making inlining decisions.
I don't see that adding a hook to provide target specific tuning for size
estimates at this level is going to be useful enough to justify maintenance
cost of such code. Sadly inlining heuristics is one of the most important and
least informed parts of optimization queue.
Honza
PS: In your testcase x86-64 will pass in register and won't need stack frame
either.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30908