aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2008-04-08 10:59:34 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2008-04-08 08:59:34 +0000
commit38173d38cc4d944f209f1b2e0101fb176ac21e84 (patch)
tree72b27dbbc1af80f97285e66868faf1c622ad35d0 /gcc/function.c
parent02ba6f3c841d89ddf6d2ab6ce8e54b69ed36bf10 (diff)
downloadgcc-38173d38cc4d944f209f1b2e0101fb176ac21e84.zip
gcc-38173d38cc4d944f209f1b2e0101fb176ac21e84.tar.gz
gcc-38173d38cc4d944f209f1b2e0101fb176ac21e84.tar.bz2
function.h (incomming_args): Break out of struct function.
* function.h (incomming_args): Break out of struct function. (function_subsections): Break out of struct function. (rtl_data): Add args, subsections fields. Break out outgoing_args_size, return_rtx and hard_reg_initial_vals from struct function. Kill inl_max_label_num. (current_function_pops_args, current_function_args_info, current_function_args_size, current_function_args_size, current_function_pretend_args_size, current_function_outgoing_args_size, current_function_internal_arg_pointer, current_function_return_rtx): Kill compatibility accestor macros. * builtins.c (expand_builtin_apply_args_1): Update. (expand_builtin_next_arg): Update. * df-scan.c (df_get_call_refs): Update. * dbxout.c (dbxout_function_end): Update. * dwarf2out.c (dwarf2out_switch_text_section): Update. (output_line_info): Update. (secname_for_decl): Update. (dwarf2out_var_location): Update. * function.c (free_after_compilation): Update. (assign_parm_find_stack_rtl): Update. (assign_parms): Update. (expand_dummy_function_end): Update. (expand_function_end): Update. * calls.c (mem_overlaps_already_clobbered_arg_p): Update. (expand_call): Update. (emit_library_call_value_1): Update. (store_one_arg): Update. * varasm.c (initialize_cold_section_name): Update. (unlikely_text_section): Update. (unlikely_text_section_p): Update. (assemble_start_function): Update. (assemble_end_function): Update. (default_section_type_flags): Update. (switch_to_section): Update. * integrate.c (set_decl_abstract_flags): Update. (get_hard_reg_initial_val): Update. (has_hard_reg_initial_val): Update. (allocate_initial_values): Update. * resource.c (init_resource_info): Update. * config/alpha/alpha.c (NUM_ARGS): Update. (direct_return): Update. (alpha_va_start): Update. (alpha_sa_size): Update. (alpha_initial_elimination_offset): Update. (alpha_expand_prologue): Update. (alpha_start_function): Update. (alpha_expand_epilogue): Update. (unicosmk_initial_elimination_offset): * config/alpha/alpha.md (call expander): Update. * config/s390/s390.c (s390_register_info): Update. (s390_register_info): Update. (s390_frame_info): Update. (s390_initial_elimination_offset): Update. (s390_build_builtin_va_list): Update. (s390_va_start): Update. * config/spu/spu.c (direct_return): Update. (spu_expand_prologue): Update. (spu_initial_elimination_offset): Update. (spu_build_builtin_va_list): Update. (spu_va_start): Update. * config/sparc/sparc.c (sparc_init_modes): Update. (sparc_compute_frame_size): Update. (function_value): Update. * config/m32r/m32r.c (m32r_compute_frame_size): Update. * config/i386/i386.md (return expander): Update. * config/i386/i386.c (ix86_va_start): Update. (ix86_can_use_return_insn_p): Update. (ix86_compute_frame_layout): Update. (ix86_expand_epilogue): Update. * config/sh/sh.c (output_stack_adjust): Update. (calc_live_regs): Update. (sh_expand_prologue): Update. (sh_builtin_saveregs): Update. (sh_va_start): Update. (initial_elimination_offset): Update. (sh_allocate_initial_value): Update. (sh_function_ok_for_sibcall): Update. (sh_get_pr_initial_val): Update. * config/sh/sh.md (return expander): Update. * config/avr/avr.c (frame_pointer_required_p): UPdate. * config/crx/crx.c (crx_compute_frame): UPdate. (crx_initial_elimination_offset): UPdate. * config/xtensa/xtensa.c (compute_frame_size): Update (xtensa_builtin_saveregs): Update. (xtensa_va_start): Update. (order_regs_for_local_alloc): Update. * config/stormy16/stormy16.c (xstormy16_compute_stack_layout): Update. (xstormy16_expand_builtin_va_start): Update. * config/fr30/fr30.c (fr30_compute_frame_size): Update. * config/m68hc11/m68hc11.md (return expanders): Update. * config/m68hc11/m68hc11.c (expand_prologue): Update. (expand_epilogue): Update. * config/cris/cris.c (cris_initial_frame_pointer_offset): Update. (cris_simple_epilogue): Update. (cris_expand_prologue): Update. (cris_expand_epilogue): Update. * config/iq2000/iq2000.c (iq2000_va_start): Update. (compute_frame_size): Update. * config/mt/mt.c (mt_compute_frame_size): Update. * config/mn10300/mn10300.c (expand_prologue): Update. (expand_epilogue): Update. (initial_offset): Update. (mn10300_builtin_saveregs): * config/mn10300/mn10300.md (return expander): Update. * config/ia64/ia64.c (ia64_compute_frame_size): Update. (ia64_initial_elimination_offset): Update. (ia64_initial_elimination_offset): Update. (ia64_expand_prologue): Update. * config/m68k/m68k.md (return expander): Update. * config/rs6000/rs6000.c (rs6000_va_start): Update. (rs6000_stack_info): Update. * config/mcore/mcore.c (layout_mcore_frame): Update. (mcore_expand_prolog): Update. * config/arc/arc.c (arc_compute_frame_size): Update. * config/score/score3.c (score3_compute_frame_size): Update. * config/score/score7.c (score7_compute_frame_size): Update. * config/arm/arm.c (use_return_insn): Update. (thumb_find_work_register): Update. (arm_compute_save_reg_mask): Update. (arm_output_function_prologue): Update. (arm_output_epilogue): Update. (arm_size_return_regs): Update. (arm_get_frame_offsets): Update. (arm_expand_prologue): Update. (thumb_exit): Update. (thumb_unexpanded_epilogue): Update. (thumb1_output_function_prologue): Update. * config/pa/pa.md (return expander): Update. * config/pa/pa.c (compute_frame_size): Update. (hppa_builtin_saveregs): Update. * config/mips/mips.c (mips_va_start): Update. (mips16_build_function_stub): Update. (mips_compute_frame_info): Update. (mips_restore_gp): Update. (mips_output_function_prologue): Update. (mips_expand_prologue): Update. * config/v850/v850.c (compute_frame_size): Update. (expand_prologue): * config/mmix/mmix.c (along): update. (mmix_initial_elimination_offset): update. (mmix_reorg): update. (mmix_use_simple_return): update. (mmix_expand_prologue): update. (mmix_expand_epilogue): Update. * config/bfin/bfin.c (bfin_initial_elimination_offset): Update. (emit_link_insn): Update. From-SVN: r134087
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/gcc/function.c b/gcc/function.c
index a2fdcaa..6a2e987 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -289,9 +289,6 @@ free_after_compilation (struct function *f)
f->machine = NULL;
f->cfg = NULL;
- f->arg_offset_rtx = NULL;
- f->return_rtx = NULL;
- f->internal_arg_pointer = NULL;
f->epilogue_delay_list = NULL;
}
@@ -1143,18 +1140,18 @@ static int cfa_offset;
parameters. However, if OUTGOING_REG_PARM_STACK space is not defined,
stack space for register parameters is not pushed by the caller, but
rather part of the fixed stack areas and hence not included in
- `current_function_outgoing_args_size'. Nevertheless, we must allow
+ `crtl->outgoing_args_size'. Nevertheless, we must allow
for it when allocating stack dynamic objects. */
#if defined(REG_PARM_STACK_SPACE)
#define STACK_DYNAMIC_OFFSET(FNDECL) \
((ACCUMULATE_OUTGOING_ARGS \
- ? (current_function_outgoing_args_size \
+ ? (crtl->outgoing_args_size \
+ (OUTGOING_REG_PARM_STACK_SPACE ? 0 : REG_PARM_STACK_SPACE (FNDECL))) \
: 0) + (STACK_POINTER_OFFSET))
#else
#define STACK_DYNAMIC_OFFSET(FNDECL) \
-((ACCUMULATE_OUTGOING_ARGS ? current_function_outgoing_args_size : 0) \
+((ACCUMULATE_OUTGOING_ARGS ? crtl->outgoing_args_size : 0) \
+ (STACK_POINTER_OFFSET))
#endif
#endif
@@ -2263,7 +2260,7 @@ assign_parm_find_stack_rtl (tree parm, struct assign_parm_data_one *data)
else
offset_rtx = ARGS_SIZE_RTX (data->locate.offset);
- stack_parm = current_function_internal_arg_pointer;
+ stack_parm = crtl->args.internal_arg_pointer;
if (offset_rtx != const0_rtx)
stack_parm = gen_rtx_PLUS (Pmode, stack_parm, offset_rtx);
stack_parm = gen_rtx_MEM (data->promoted_mode, stack_parm);
@@ -2949,7 +2946,7 @@ assign_parms (tree fndecl)
struct assign_parm_data_all all;
tree fnargs, parm;
- current_function_internal_arg_pointer
+ crtl->args.internal_arg_pointer
= targetm.calls.internal_arg_pointer ();
assign_parms_initialize_all (&all);
@@ -3029,48 +3026,48 @@ assign_parms (tree fndecl)
}
/* We have aligned all the args, so add space for the pretend args. */
- current_function_pretend_args_size = all.pretend_args_size;
+ crtl->args.pretend_args_size = all.pretend_args_size;
all.stack_args_size.constant += all.extra_pretend_bytes;
- current_function_args_size = all.stack_args_size.constant;
+ crtl->args.size = all.stack_args_size.constant;
/* Adjust function incoming argument size for alignment and
minimum length. */
#ifdef REG_PARM_STACK_SPACE
- current_function_args_size = MAX (current_function_args_size,
+ crtl->args.size = MAX (crtl->args.size,
REG_PARM_STACK_SPACE (fndecl));
#endif
- current_function_args_size = CEIL_ROUND (current_function_args_size,
+ crtl->args.size = CEIL_ROUND (crtl->args.size,
PARM_BOUNDARY / BITS_PER_UNIT);
#ifdef ARGS_GROW_DOWNWARD
- current_function_arg_offset_rtx
+ crtl->args.arg_offset_rtx
= (all.stack_args_size.var == 0 ? GEN_INT (-all.stack_args_size.constant)
: expand_expr (size_diffop (all.stack_args_size.var,
size_int (-all.stack_args_size.constant)),
NULL_RTX, VOIDmode, 0));
#else
- current_function_arg_offset_rtx = ARGS_SIZE_RTX (all.stack_args_size);
+ crtl->args.arg_offset_rtx = ARGS_SIZE_RTX (all.stack_args_size);
#endif
/* See how many bytes, if any, of its args a function should try to pop
on return. */
- current_function_pops_args = RETURN_POPS_ARGS (fndecl, TREE_TYPE (fndecl),
- current_function_args_size);
+ crtl->args.pops_args = RETURN_POPS_ARGS (fndecl, TREE_TYPE (fndecl),
+ crtl->args.size);
/* For stdarg.h function, save info about
regs and stack space used by the named args. */
- current_function_args_info = all.args_so_far;
+ crtl->args.info = all.args_so_far;
/* Set the rtx used for the function return value. Put this in its
own variable so any optimizers that need this information don't have
to include tree.h. Do this here so it gets done when an inlined
function gets output. */
- current_function_return_rtx
+ crtl->return_rtx
= (DECL_RTL_SET_P (DECL_RESULT (fndecl))
? DECL_RTL (DECL_RESULT (fndecl)) : NULL_RTX);
@@ -3091,10 +3088,10 @@ assign_parms (tree fndecl)
real_decl_rtl = targetm.calls.function_value (TREE_TYPE (decl_result),
fndecl, true);
REG_FUNCTION_VALUE_P (real_decl_rtl) = 1;
- /* The delay slot scheduler assumes that current_function_return_rtx
+ /* The delay slot scheduler assumes that crtl->return_rtx
holds the hard register containing the return value, not a
temporary pseudo. */
- current_function_return_rtx = real_decl_rtl;
+ crtl->return_rtx = real_decl_rtl;
}
}
}
@@ -4291,7 +4288,7 @@ expand_dummy_function_end (void)
void
diddle_return_value (void (*doit) (rtx, void *), void *arg)
{
- rtx outgoing = current_function_return_rtx;
+ rtx outgoing = crtl->return_rtx;
if (! outgoing)
return;
@@ -4452,7 +4449,7 @@ expand_function_end (void)
? REGNO (decl_rtl) >= FIRST_PSEUDO_REGISTER
: DECL_REGISTER (decl_result))
{
- rtx real_decl_rtl = current_function_return_rtx;
+ rtx real_decl_rtl = crtl->return_rtx;
/* This should be set in assign_parms. */
gcc_assert (REG_FUNCTION_VALUE_P (real_decl_rtl));
@@ -4460,7 +4457,7 @@ expand_function_end (void)
/* If this is a BLKmode structure being returned in registers,
then use the mode computed in expand_return. Note that if
decl_rtl is memory, then its mode may have been changed,
- but that current_function_return_rtx has not. */
+ but that crtl->return_rtx has not. */
if (GET_MODE (real_decl_rtl) == BLKmode)
PUT_MODE (real_decl_rtl, GET_MODE (decl_rtl));
@@ -4557,7 +4554,7 @@ expand_function_end (void)
/* Show return register used to hold result (in this case the address
of the result. */
- current_function_return_rtx = outgoing;
+ crtl->return_rtx = outgoing;
}
/* Emit the actual code to clobber return register. */