------- Comment #9 from jakub at gcc dot gnu dot org 2009-01-28 21:08 -------
The #c6 patch doesn't make sense to me.
Two alternative testcases:
inline __attribute__ ((always_inline))
void A (void)
{
int i;
asm volatile ("" : "=m" (i));
A ();
A ();
}
int
main ()
{
A ();
return 0;
}
and
inline void A (void);
inline void B (void);
inline __attribute__ ((always_inline))
void C (void)
{
B ();
}
inline __attribute__ ((always_inline))
void B (void)
{
A ();
}
inline __attribute__ ((always_inline))
void A (void)
{
int i;
asm volatile ("" : "=m" (i));
A ();
C ();
}
int
main ()
{
A ();
return 0;
}
As the cgraph_decide_inlining_incrementally + try_inline combo goes
depth-first, it discovers just the first (perhaps indirect) recursive inlining
only, the others mean we keep recursing with deeper and deeper depths. I
wonder if it couldn't go breadth-first instead. Honza?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38844