aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorKurt Garloff <garloff@suse.de>2003-03-02 21:18:16 +0000
committerGeoffrey Keating <geoffk@gcc.gnu.org>2003-03-02 21:18:16 +0000
commitbc52247263d666d1e942145d1f643491a0c2d81a (patch)
tree8779d656c10e23abf78abe1a1c94a499d158237b /gcc/tree-inline.c
parentf4ae98be562f298bbf51fd9b54ccce7f1ab0d0e6 (diff)
downloadgcc-bc52247263d666d1e942145d1f643491a0c2d81a.zip
gcc-bc52247263d666d1e942145d1f643491a0c2d81a.tar.gz
gcc-bc52247263d666d1e942145d1f643491a0c2d81a.tar.bz2
params.def: Introduce parameter max-inline-insns-rtl for a separate limit for the RTL inliner.
2003-03-02 Kurt Garloff <garloff@suse.de> * params.def: Introduce parameter max-inline-insns-rtl for a separate limit for the RTL inliner. * params.h: Likewise. * integrate.c (function_cannot_inline_p): Use it. * toplev.c (decode_f_option): Set multiple parameters controlling inlining with -finline-limit. * params.def: Fix orthographic and typographic errors. * doc/invoke.texi: Document parameters controlling inlining and the way -finline-limit sets multiple of them. * tree.h (struct tree_decl): Introduce inlined_function_flag, recording whether the function became eligible for inlining by a compiler flag rather than the declaration. Provide DID_INLINE_FUNC macro to access it. * c-decl.c (grokdeclarator): Set DID_INLINE_FUNC. * cp/decl.c (grokfndecl): Likewise. * toplev.c (rest_of_compilation): Likewise. * cp/optimize (maybe_clone_body): Copy DID_INLINE_FUNC. * print-tree.c (print_node): Report it. * params.def: Introduce new max-inline-insns-auto limit. * params.h: Likewise. * tree-inline.c (inlinable_function_p): Apply it to functions with DID_INLINE_FUNC set. * toplev.c (decode_f_option): Initialize it from -finline-limit value. * doc/invoke.texi: Document new parameter. From-SVN: r63688
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 71c4018d..5b5e775 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -935,6 +935,7 @@ inlinable_function_p (fn, id)
{
int inlinable;
int currfn_insns;
+ int max_inline_insns_single = MAX_INLINE_INSNS_SINGLE;
/* If we've already decided this function shouldn't be inlined,
there's no need to check again. */
@@ -943,7 +944,13 @@ inlinable_function_p (fn, id)
/* Assume it is not inlinable. */
inlinable = 0;
-
+
+ /* We may be here either because fn is declared inline or because
+ we use -finline-functions. For the second case, we are more
+ restrictive. */
+ if (DID_INLINE_FUNC (fn))
+ max_inline_insns_single = MAX_INLINE_INSNS_AUTO;
+
/* The number of instructions (estimated) of current function. */
currfn_insns = DECL_NUM_STMTS (fn) * INSNS_PER_STMT;
@@ -962,7 +969,7 @@ inlinable_function_p (fn, id)
function to be of MAX_INLINE_INSNS_SINGLE size. Make special
allowance for extern inline functions, though. */
else if (! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
- && currfn_insns > MAX_INLINE_INSNS_SINGLE)
+ && currfn_insns > max_inline_insns_single)
;
/* We can't inline functions that call __builtin_longjmp at all.
The non-local goto machenery really requires the destination