--- gcc/cp/optimize.c.orig Thu Jun 7 00:50:22 2001 +++ gcc/cp/optimize.c.v1 Thu Aug 30 13:30:05 2001 @@ -640,8 +640,9 @@ /* We can't inline varargs functions. */ else if (varargs_function_p (fn)) ; - /* We can't inline functions that are too big. */ - else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS) + /* We can't inline functions that are too big. + * Only allow a single function to eat up half of our budget. */ + else if (DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 2) ; /* All is well. We can inline this function. Traditionally, GCC has refused to inline functions using alloca, or functions whose @@ -655,9 +656,10 @@ /* Even if this function is not itself too big to inline, it might be that we've done so much inlining already that we don't want to - risk inlining any more. */ - if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT - > MAX_INLINE_INSNS) + risk too much inlining any more and thus halve the acceptable size. */ + if ((DECL_NUM_STMTS (fn) + id->inlined_stmts) * INSNS_PER_STMT + > MAX_INLINE_INSNS + && DECL_NUM_STMTS (fn) * INSNS_PER_STMT > MAX_INLINE_INSNS / 4) inlinable = 0; /* We can inline a template instantiation only if it's fully --- gcc/cp/ChangeLog.orig Mon Aug 20 20:48:06 2001 +++ gcc/cp/ChangeLog.v1 Thu Aug 30 13:29:46 2001 @@ -1,3 +1,8 @@ +2001-08-22 Kurt Garloff + + * optimize.c (inlinable_function_p): Allow only smaller single + functions. Halve inline limit after reaching recursive limit. + 2001-08-19 Release Manager * GCC 3.0.1 Released.