This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/42632] [4.5 Regression] unimplemented: inlining failed in call to ‘pskb_trim’: recursive inlining



------- Comment #3 from rguenth at gcc dot gnu dot org  2010-01-06 12:26 -------
Hm, I reduced it to something that is not a regression anymore.  The original
testcase though works with 4.4 but fails with 4.5.  I guess the real problem
is latent.

static inline __attribute__((always_inline)) int
__pskb_trim(void)
{
  return ___pskb_trim();
}
static inline __attribute__((always_inline)) 
int pskb_trim(void)
{
  return __pskb_trim();
}
int ___pskb_trim(void)
{
  pskb_trim();
  return 0;
}

Is rejected at -O2 but accepted at -O1.  The issue is that we do not
compute always-inline inlines at once in one place but during early
inlining do

;; Function ___pskb_trim (___pskb_trim)
Considering to always inline inline candidate pskb_trim.
Not inlining: SSA form does not match.

;; Function __pskb_trim (__pskb_trim)
Considering inline candidate ___pskb_trim.
 Inlining ___pskb_trim into __pskb_trim.

;; Function pskb_trim (pskb_trim)
Considering to always inline inline candidate __pskb_trim.
 Inlining __pskb_trim into pskb_trim.
 Considering to always inline inline candidate pskb_trim.
 Not inlining: recursive call.
Inlining __pskb_trim to pskb_trim with frequency 1000

and with that particular oder of inlining (note especially how we
inline a non-always-inline function into an always-inline function!)
we end up with

pskb_trim ()
{
  int D.1969;
  int D.1969;
  int D.1961;

<bb 2>:
  pskb_trim ();
  D.1969_5 = 0;
  D.1961_1 = D.1969_5;
  return D.1961_1;

}

which the IPA inliner complains about.  At -O1 we do not perform the
bogus inlining during early inlining.

Now the cgraph has a very simple inlining solution:

int ___pskb_trim(void)
{
  ___pskb_trim();
  return 0;
}

and we better produce that.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|regression                  |tree-optimization
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-01-06 12:26:10
               date|                            |
            Summary|unimplemented: inlining     |[4.5 Regression]
                   |failed in call to           |unimplemented: inlining
                   |?pskb_trim?: recursive      |failed in call to
                   |inlining                    |?pskb_trim?: recursive
                   |                            |inlining
   Target Milestone|---                         |4.5.0


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


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