------- Comment #12 from hubicka at gcc dot gnu dot org 2009-02-02 16:35 ------- try_inline should not recurse when edge is already inlined. The following patch should fix the problem, I will benchmark it tonight Index: ipa-inline.c =================================================================== --- ipa-inline.c (revision 143680) +++ ipa-inline.c (working copy) @@ -1330,16 +1330,18 @@ try_inline (struct cgraph_edge *e, enum cgraph_node_name (e->caller)); } if (e->inline_failed) - cgraph_mark_inline (e); + { + cgraph_mark_inline (e);
- /* In order to fully inline always_inline functions, we need to - recurse here, since the inlined functions might not be processed by - incremental inlining at all yet. + /* In order to fully inline always_inline functions, we need to + recurse here, since the inlined functions might not be processed by + incremental inlining at all yet. - Also flattening needs to be done recursively. */ + Also flattening needs to be done recursively. */ - if (mode == INLINE_ALL || always_inline) - cgraph_decide_inlining_incrementally (e->callee, mode, depth + 1); + if (mode == INLINE_ALL || always_inline) + cgraph_decide_inlining_incrementally (e->callee, mode, depth + 1); + } callee->aux = (void *)(size_t) callee_mode; return true; } -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38844