This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PR C++/35262


Hi,
the ABI check miscompare was caused by inliner no longer inlining a
function
f(param)
{
  if (cond)
    external_call (param);
}
into cold regions correctly concluding that doing so would increase code
size.  However since the function is called just few times, inlining it
fully leads to code size savings by eliminating offline copy and this
fact wasn't tested in inliner. So instead of fixing the ABI check list
of symbols I am adding code to handle this in inliner.

Bootstrapped/regtested i686-linux, committed.
My apologizes for taking so long to handle this failure

	PR c++/35262
	* ipa-inline.c (cgraph_decide_inlining_of_small_function): Be more
	aggressive on inlining cold calls.
Index: ipa-inline.c
===================================================================
*** ipa-inline.c	(revision 132800)
--- ipa-inline.c	(working copy)
*************** cgraph_decide_inlining_of_small_function
*** 925,931 ****
   	not_good = N_("function not declared inline and code size would grow");
        if (optimize_size)
   	not_good = N_("optimizing for size and code size would grow");
!       if (not_good && growth > 0)
  	{
            if (!cgraph_recursive_inlining_p (edge->caller, edge->callee,
  				            &edge->inline_failed))
--- 925,931 ----
   	not_good = N_("function not declared inline and code size would grow");
        if (optimize_size)
   	not_good = N_("optimizing for size and code size would grow");
!       if (not_good && growth > 0 && cgraph_estimate_growth (edge->callee) > 0)
  	{
            if (!cgraph_recursive_inlining_p (edge->caller, edge->callee,
  				            &edge->inline_failed))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]