aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
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