https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108351

Xionghu Luo (luoxhu at gcc dot gnu.org) <yinyuefengyi at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yinyuefengyi at gmail dot com

--- Comment #3 from Xionghu Luo (luoxhu at gcc dot gnu.org) <yinyuefengyi at 
gmail dot com> ---
(In reply to Andrew Pinski from comment #2)
> I noticed that with the C++ front-end early inline inlines f into main but
> with the C front-end it does not ...

C++ generates different call instructions with C front-end:

<   D.3747 = f (7, 7);
<   D.3748 = f (9, 7);
---
>   f (7, 7);
>   f (9, 7);


then an extra return_cost cost is added to C++ front-end:

<   D.3747 = f (7, 7);
<               freq:1.00 size:  4 time: 13
<   D.3748 = f (9, 7);
<               freq:1.00 size:  4 time: 13
---
>   f (7, 7);
>               freq:1.00 size:  3 time: 12
>   f (9, 7);
>               freq:1.00 size:  3 time: 12


early inline pass inlines the two calls with C front-end but fails to inline
them with C++ front-end due to "growth 8 exceeds --param early-inlining-insns 
divided by number of calls". 

gcc/ipa-inline.cc:747    growth * (n + 1) > early_inlining_insns

gcc/opts.cc:687    { OPT_LEVELS_3_PLUS, OPT__param_early_inlining_insns_, NULL,
14 },


Tried revert the commit r13-4240-gfeeb0d68f1c708, the two calls still exits,
need also revert the commit r13-4686-g095a13eda2caf6.
(r13-4686 mentioned IPA-SRA detects whether parameters could be removed,
obviously it doesn't work well now if constants are not propagated before
IPA-SRA, it seems that the IPA-SRA only remove locally_unused parameters but
'm' is not locally used and the constants from caller are not visible in
IPA-SRA?)

Reply via email to