This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/30908] -Os inlines functions that are called more than once (optimization regression)
- From: "j at uriah dot heep dot sax dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 21 Feb 2007 14:46:46 -0000
- Subject: [Bug c/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 #6 from j at uriah dot heep dot sax dot de 2007-02-21 14:46 -------
(In reply to comment #5)
> Unfortunately(?) the cost metrics for inlining are completely target
> independent at the moment. Can you check whether adjusting --param
> inline-call-cost will
> fix it for you?
Only if I change it to 0, I get a different picture:
---8<---
Deciding on inlining. Starting with 8 insns.
Inlining always_inline functions:
Deciding on smaller functions:
Considering inline candidate wait.
Considering wait with 4 insns
to be inlined into main
Estimated growth after inlined into all callees is +2 insns.
Estimated badness is 4, frequency 100.00.
Inlined into main which now has 7 insns,net change of +3 insns.
Considering wait with 4 insns
to be inlined into main
Estimated growth after inlined into all callees is -1 insns.
Estimated badness is 1, frequency 100.00.
Inlined into main which now has 10 insns,net change of -1 insns.
Deciding on functions called once:
Inlined 2 calls, eliminated 1 functions, 8 insns turned to 10 insns.
...
---8<---
So it inlines them still, even though it knows the resulting code will
grow. :-(
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30908