diff options
author | Kurt Garloff <garloff@suse.de> | 2001-08-30 13:55:17 +0000 |
---|---|---|
committer | Gerald Pfeifer <gerald@gcc.gnu.org> | 2001-08-30 13:55:17 +0000 |
commit | 598e9ba5bd920939ca3ff1ef2f57299bea665d6e (patch) | |
tree | cae4e0cb4dbf6c8771fb49c7bf4fc43074d8e219 /gcc/cp/optimize.c | |
parent | 95602da11cade17438211fe316b95e9dd5a68dd4 (diff) | |
download | gcc-598e9ba5bd920939ca3ff1ef2f57299bea665d6e.zip gcc-598e9ba5bd920939ca3ff1ef2f57299bea665d6e.tar.gz gcc-598e9ba5bd920939ca3ff1ef2f57299bea665d6e.tar.bz2 |
optimize.c (inlinable_function_p): Allow only smaller single functions.
* optimize.c (inlinable_function_p): Allow only smaller single
functions. Halve inline limit after reaching recursive limit.
From-SVN: r45286
Diffstat (limited to 'gcc/cp/optimize.c')
-rw-r--r-- | gcc/cp/optimize.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c index c0ebb99..95d02b7 100644 --- a/gcc/cp/optimize.c +++ b/gcc/cp/optimize.c @@ -659,8 +659,9 @@ inlinable_function_p (fn, id) /* 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 @@ -674,9 +675,10 @@ inlinable_function_p (fn, id) /* 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 |