diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2001-10-05 04:20:27 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2001-10-05 04:20:27 +0000 |
commit | 4838c5ee553f062d75d0a6288a025e98600de97c (patch) | |
tree | 8ce05ef7518fd1359d3ae5d044511179f1ea1c8f /gcc/integrate.c | |
parent | 8d5463d486fe257414a840e204531a8e4405a9a6 (diff) | |
download | gcc-4838c5ee553f062d75d0a6288a025e98600de97c.zip gcc-4838c5ee553f062d75d0a6288a025e98600de97c.tar.gz gcc-4838c5ee553f062d75d0a6288a025e98600de97c.tar.bz2 |
Makefile.in (c-decl.o): Depend on tree-inline.h.
* Makefile.in (c-decl.o): Depend on tree-inline.h.
(c-lang.o): Likewise, as well as insn-config.h and integrate.h.
* c-decl.c: Include tree-inline.h.
(c_expand_body): Call optimize_inline_calls. Determine whether
a function is inlinable upfront, and only clear
DECL_SAVED_TREE, DECL_INITIAL and DECL_ARGUMENTS if it isn't.
* c-lang.c: Include tree-inline.h, insn-config.h and integrate.h.
(c_disregard_inline_limits): New function.
(inline_forbidden_p, c_cannot_inline_tree_fn): Likewise.
(c_post_options): Enable tree inlining if inlining is enabled.
Don't inline trees when instrumenting functions.
(c_init): Initialize lang_disregard_inline_limits and
lang_cannot_inline_tree_fn.
* tree-inline.c (initialize_inlined_parameters): Handle calls
with fewer arguments than declared parameters, and fewer
parameters than passed arguments. Don't assume value is a
DECL.
(declare_return_variable): Convert return value back to the
original type, if it was promoted.
(tree_inlinable_function_p): New function.
(inlinable_function_p): Don't look at DECL_INLINE if we're
inlining all functions. Make it work with a NULL id.
Re-check DECL_UNINLINABLE after language-specific checks.
(varargs_function_p): Move back to cp/tree.c.
* tree-inline.h (tree_inlinable_function_p): Declare it.
(varargs_function_p): Removed declaration.
* integrate.h (function_attribute_inlinable_p): Declare it.
* integrate.c (function_attribute_inlinable_p): Export it.
(save_for_inline): Don't bother to prepare argvec when not
inlining.
* cse.c (check_for_label_ref): Don't check deleted labels.
From-SVN: r46025
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index 9105dee..ddd1ce2 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -440,8 +440,8 @@ save_for_inline (fndecl) Also set up ARG_VECTOR, which holds the unmodified DECL_RTX values for the parms, prior to elimination of virtual registers. These values are needed for substituting parms properly. */ - - parmdecl_map = (tree *) xmalloc (max_parm_reg * sizeof (tree)); + if (! flag_no_inline) + parmdecl_map = (tree *) xmalloc (max_parm_reg * sizeof (tree)); /* Make and emit a return-label if we have not already done so. */ @@ -451,7 +451,10 @@ save_for_inline (fndecl) emit_label (return_label); } - argvec = initialize_for_inline (fndecl); + if (! flag_no_inline) + argvec = initialize_for_inline (fndecl); + else + argvec = NULL; /* Delete basic block notes created by early run of find_basic_block. The notes would be later used by find_basic_blocks to reuse the memory @@ -468,27 +471,31 @@ save_for_inline (fndecl) if (GET_CODE (insn) != NOTE) abort (); - /* Get the insn which signals the end of parameter setup code. */ - first_nonparm_insn = get_first_nonparm_insn (); - - /* Now just scan the chain of insns to see what happens to our - PARM_DECLs. If a PARM_DECL is used but never modified, we - can substitute its rtl directly when expanding inline (and - perform constant folding when its incoming value is constant). - Otherwise, we have to copy its value into a new register and track - the new register's life. */ - in_nonparm_insns = 0; - save_parm_insns (insn, first_nonparm_insn); - - cfun->inl_max_label_num = max_label_num (); - cfun->inl_last_parm_insn = cfun->x_last_parm_insn; - cfun->original_arg_vector = argvec; + if (! flag_no_inline) + { + /* Get the insn which signals the end of parameter setup code. */ + first_nonparm_insn = get_first_nonparm_insn (); + + /* Now just scan the chain of insns to see what happens to our + PARM_DECLs. If a PARM_DECL is used but never modified, we + can substitute its rtl directly when expanding inline (and + perform constant folding when its incoming value is + constant). Otherwise, we have to copy its value into a new + register and track the new register's life. */ + in_nonparm_insns = 0; + save_parm_insns (insn, first_nonparm_insn); + + cfun->inl_max_label_num = max_label_num (); + cfun->inl_last_parm_insn = cfun->x_last_parm_insn; + cfun->original_arg_vector = argvec; + } cfun->original_decl_initial = DECL_INITIAL (fndecl); cfun->no_debugging_symbols = (write_symbols == NO_DEBUG); DECL_SAVED_INSNS (fndecl) = cfun; /* Clean up. */ - free (parmdecl_map); + if (! flag_no_inline) + free (parmdecl_map); } /* Scan the chain of insns to see what happens to our PARM_DECLs. If a |