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.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index e1fab06..a49dca9 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -115,7 +115,7 @@ static tree copy_body_r PARAMS ((tree *, int *, void *));
static tree copy_body PARAMS ((inline_data *));
static tree expand_call_inline PARAMS ((tree *, int *, void *));
static void expand_calls_inline PARAMS ((tree *, inline_data *));
-static int inlinable_function_p PARAMS ((tree, inline_data *));
+static int inlinable_function_p PARAMS ((tree, inline_data *, int));
static tree remap_decl PARAMS ((tree, inline_data *));
#ifndef INLINER_FOR_JAVA
static tree initialize_inlined_parameters PARAMS ((inline_data *, tree, tree));
@@ -872,10 +872,11 @@ declare_return_variable (id, return_slot_addr, var)
/* Returns nonzero if a function can be inlined as a tree. */
int
-tree_inlinable_function_p (fn)
+tree_inlinable_function_p (fn, nolimit)
tree fn;
+ int nolimit;
{
- return inlinable_function_p (fn, NULL);
+ return inlinable_function_p (fn, NULL, nolimit);
}
/* If *TP is possibly call to alloca, return nonzero. */
@@ -939,9 +940,10 @@ find_builtin_longjmp_call (exp)
can be inlined at all. */
static int
-inlinable_function_p (fn, id)
+inlinable_function_p (fn, id, nolimit)
tree fn;
inline_data *id;
+ int nolimit;
{
int inlinable;
int currfn_insns;
@@ -973,12 +975,13 @@ inlinable_function_p (fn, id)
front-end that must set DECL_INLINE in this case, because
dwarf2out loses if a function is inlined that doesn't have
DECL_INLINE set. */
- else if (! DECL_INLINE (fn))
+ else if (! DECL_INLINE (fn) && !nolimit)
;
/* We can't inline functions that are too big. Only allow a single
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)
+ else if (!nolimit
+ && ! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
&& currfn_insns > max_inline_insns_single)
;
/* We can't inline functions that call __builtin_longjmp at all.
@@ -1009,7 +1012,7 @@ inlinable_function_p (fn, id)
/* In case we don't disregard the inlining limits and we basically
can inline this function, investigate further. */
if (! (*lang_hooks.tree_inlining.disregard_inline_limits) (fn)
- && inlinable)
+ && inlinable && !nolimit)
{
int sum_insns = (id ? id->inlined_stmts : 0) * INSNS_PER_STMT
+ currfn_insns;
@@ -1158,7 +1161,9 @@ expand_call_inline (tp, walk_subtrees, data)
/* Don't try to inline functions that are not well-suited to
inlining. */
- if (!inlinable_function_p (fn, id))
+ if ((!flag_unit_at_a_time || !DECL_SAVED_TREE (fn)
+ || !cgraph_global_info (fn)->inline_once)
+ && !inlinable_function_p (fn, id, 0))
return NULL_TREE;
if (! (*lang_hooks.tree_inlining.start_inlining) (fn))