------- Comment #4 from krebbel1 at de dot ibm dot com  2005-10-17 14:42 -------
I think the problem is that cgraph_decide_recursive_inlining returns true even
if nothing got inlined. That may happen if the function is already more often
inlined into itself than max_depth. In this case the body of the while loop is
not even once executed. With the attached patch the function returns true only
if the counter n got increased at least once indicating that inlining took
place. This patchfixes the bug for the 197.parser testcase and bootstraps on
s390 and s390x without testsuite regressions. It survived a profiledbootstrap
on i686 without producing testsuite regressions.

Index: gcc/ipa-inline.c
===================================================================
*** gcc/ipa-inline.c.orig       2005-10-11 17:20:15.000000000 +0200
--- gcc/ipa-inline.c    2005-10-17 13:58:56.000000000 +0200
*************** cgraph_decide_recursive_inlining (struct
*** 650,656 ****
       function.  At this place we should probably walk the function and
       inline clones and compensate the counts accordingly.  This probably
       doesn't matter much in practice.  */
!   return true;
  }

  /* Set inline_failed for all callers of given function to REASON.  */
--- 650,656 ----
       function.  At this place we should probably walk the function and
       inline clones and compensate the counts accordingly.  This probably
       doesn't matter much in practice.  */
!   return n > 0;
  }

  /* Set inline_failed for all callers of given function to REASON.  */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24093

Reply via email to