* 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
+2008-04-08 Jan Hubicka <jh@suse.cz>
+
+ * 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.
+
2008-04-08 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.h (TARGET_CPU_CPP_BUILTINS): Define
as we might have pretended they were passed. Make sure it's a valid
operand, as emit_move_insn isn't expected to handle a PLUS. */
tem
- = force_operand (plus_constant (tem, current_function_pretend_args_size),
+ = force_operand (plus_constant (tem, crtl->args.pretend_args_size),
NULL_RTX);
#endif
emit_move_insn (adjust_address (registers, Pmode, 0), tem);
expand_builtin_args_info (tree exp)
{
int nwords = sizeof (CUMULATIVE_ARGS) / sizeof (int);
- int *word_ptr = (int *) ¤t_function_args_info;
+ int *word_ptr = (int *) &crtl->args.info;
gcc_assert (sizeof (CUMULATIVE_ARGS) % sizeof (int) == 0);
/* Checking arguments is already done in fold_builtin_next_arg
that must be called before this function. */
return expand_binop (ptr_mode, add_optab,
- current_function_internal_arg_pointer,
- current_function_arg_offset_rtx,
+ crtl->args.internal_arg_pointer,
+ crtl->args.arg_offset_rtx,
NULL_RTX, 0, OPTAB_LIB_WIDEN);
}
{
HOST_WIDE_INT i;
- if (addr == current_function_internal_arg_pointer)
+ if (addr == crtl->args.internal_arg_pointer)
i = 0;
else if (GET_CODE (addr) == PLUS
- && XEXP (addr, 0) == current_function_internal_arg_pointer
+ && XEXP (addr, 0) == crtl->args.internal_arg_pointer
&& GET_CODE (XEXP (addr, 1)) == CONST_INT)
i = INTVAL (XEXP (addr, 1));
/* Return true for arg pointer based indexed addressing. */
else if (GET_CODE (addr) == PLUS
- && (XEXP (addr, 0) == current_function_internal_arg_pointer
- || XEXP (addr, 1) == current_function_internal_arg_pointer))
+ && (XEXP (addr, 0) == crtl->args.internal_arg_pointer
+ || XEXP (addr, 1) == crtl->args.internal_arg_pointer))
return true;
else
return false;
|| (fndecl && decl_function_context (fndecl) == current_function_decl)
/* If this function requires more stack slots than the current
function, we cannot change it into a sibling call.
- current_function_pretend_args_size is not part of the
+ crtl->args.pretend_args_size is not part of the
stack allocated by our caller. */
- || args_size.constant > (current_function_args_size
- - current_function_pretend_args_size)
+ || args_size.constant > (crtl->args.size
+ - crtl->args.pretend_args_size)
/* If the callee pops its own arguments, then it must pop exactly
the same number of arguments as the current function. */
|| (RETURN_POPS_ARGS (fndecl, funtype, args_size.constant)
!= RETURN_POPS_ARGS (current_function_decl,
TREE_TYPE (current_function_decl),
- current_function_args_size))
+ crtl->args.size))
|| !lang_hooks.decls.ok_for_sibcall (fndecl))
try_tail_call = 0;
argblock = virtual_incoming_args_rtx;
argblock
#ifdef STACK_GROWS_DOWNWARD
- = plus_constant (argblock, current_function_pretend_args_size);
+ = plus_constant (argblock, crtl->args.pretend_args_size);
#else
- = plus_constant (argblock, -current_function_pretend_args_size);
+ = plus_constant (argblock, -crtl->args.pretend_args_size);
#endif
stored_args_map = sbitmap_alloc (args_size.constant);
sbitmap_zero (stored_args_map);
the prologue (if ACCUMULATE_OUTGOING_ARGS, or stack overflow
checking). */
- if (needed > current_function_outgoing_args_size)
- current_function_outgoing_args_size = needed;
+ if (needed > crtl->outgoing_args_size)
+ crtl->outgoing_args_size = needed;
if (must_preallocate)
{
if (!OUTGOING_REG_PARM_STACK_SPACE)
args_size.constant -= reg_parm_stack_space;
- if (args_size.constant > current_function_outgoing_args_size)
- current_function_outgoing_args_size = args_size.constant;
+ if (args_size.constant > crtl->outgoing_args_size)
+ crtl->outgoing_args_size = args_size.constant;
if (ACCUMULATE_OUTGOING_ARGS)
{
rtx x = arg->value;
int i = 0;
- if (XEXP (x, 0) == current_function_internal_arg_pointer
+ if (XEXP (x, 0) == crtl->args.internal_arg_pointer
|| (GET_CODE (XEXP (x, 0)) == PLUS
&& XEXP (XEXP (x, 0), 0) ==
- current_function_internal_arg_pointer
+ crtl->args.internal_arg_pointer
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT))
{
- if (XEXP (x, 0) != current_function_internal_arg_pointer)
+ if (XEXP (x, 0) != crtl->args.internal_arg_pointer)
i = INTVAL (XEXP (XEXP (x, 0), 1));
/* expand_call should ensure this. */
/* Get the number of args of a function in one of two ways. */
#if TARGET_ABI_OPEN_VMS || TARGET_ABI_UNICOSMK
-#define NUM_ARGS current_function_args_info.num_args
+#define NUM_ARGS crtl->args.info.num_args
#else
-#define NUM_ARGS current_function_args_info
+#define NUM_ARGS crtl->args.info
#endif
#define REG_PV 27
&& reload_completed
&& alpha_sa_size () == 0
&& get_frame_size () == 0
- && current_function_outgoing_args_size == 0
- && current_function_pretend_args_size == 0);
+ && crtl->outgoing_args_size == 0
+ && crtl->args.pretend_args_size == 0);
}
/* Return the ADDR_VEC associated with a tablejump insn. */
if (NUM_ARGS < 6)
offset = TARGET_ABI_OPEN_VMS ? UNITS_PER_WORD : 6 * UNITS_PER_WORD;
else
- offset = -6 * UNITS_PER_WORD + current_function_pretend_args_size;
+ offset = -6 * UNITS_PER_WORD + crtl->args.pretend_args_size;
if (TARGET_ABI_OPEN_VMS)
{
alpha_procedure_type
= (sa_size || get_frame_size() != 0
- || current_function_outgoing_args_size
+ || crtl->outgoing_args_size
|| current_function_stdarg || current_function_calls_alloca
|| frame_pointer_needed)
? PT_STACK : PT_REGISTER;
= (frame_pointer_needed
|| current_function_has_nonlocal_label
|| alpha_procedure_type == PT_STACK
- || current_function_outgoing_args_size)
+ || crtl->outgoing_args_size)
? REG_PV : HARD_FRAME_POINTER_REGNUM;
/* If we want to copy PV into FP, we need to find some register
HOST_WIDE_INT ret;
ret = alpha_sa_size ();
- ret += ALPHA_ROUND (current_function_outgoing_args_size);
+ ret += ALPHA_ROUND (crtl->outgoing_args_size);
switch (from)
{
case ARG_POINTER_REGNUM:
ret += (ALPHA_ROUND (get_frame_size ()
- + current_function_pretend_args_size)
- - current_function_pretend_args_size);
+ + crtl->args.pretend_args_size)
+ - crtl->args.pretend_args_size);
break;
default:
frame_size = ALPHA_ROUND (sa_size
+ (alpha_procedure_type == PT_STACK ? 8 : 0)
+ frame_size
- + current_function_pretend_args_size);
+ + crtl->args.pretend_args_size);
else if (TARGET_ABI_UNICOSMK)
/* We have to allocate space for the DSIB if we generate a frame. */
frame_size = ALPHA_ROUND (sa_size
+ (alpha_procedure_type == PT_STACK ? 48 : 0))
+ ALPHA_ROUND (frame_size
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
else
- frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
+ frame_size = (ALPHA_ROUND (crtl->outgoing_args_size)
+ sa_size
+ ALPHA_ROUND (frame_size
- + current_function_pretend_args_size));
+ + crtl->args.pretend_args_size));
if (TARGET_ABI_OPEN_VMS)
reg_offset = 8;
else
- reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
+ reg_offset = ALPHA_ROUND (crtl->outgoing_args_size);
alpha_sa_mask (&imask, &fmask);
FRP (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx));
/* If we have to allocate space for outgoing args, do it now. */
- if (current_function_outgoing_args_size != 0)
+ if (crtl->outgoing_args_size != 0)
{
rtx seq
= emit_move_insn (stack_pointer_rtx,
plus_constant
(hard_frame_pointer_rtx,
- (ALPHA_ROUND
- (current_function_outgoing_args_size))));
+ (crtl->outgoing_args_size))));
/* Only set FRAME_RELATED_P on the stack adjustment we just emitted
if ! frame_pointer_needed. Setting the bit will change the CFA
frame_pointer_needed
=> vms_unwind_regno == HARD_FRAME_POINTER_REGNUM
and
- current_function_outgoing_args_size != 0
+ crtl->outgoing_args_size != 0
=> alpha_procedure_type != PT_NULL,
so when we are not setting the bit here, we are guaranteed to
frame_size = ALPHA_ROUND (sa_size
+ (alpha_procedure_type == PT_STACK ? 8 : 0)
+ frame_size
- + current_function_pretend_args_size);
+ + crtl->args.pretend_args_size);
else if (TARGET_ABI_UNICOSMK)
frame_size = ALPHA_ROUND (sa_size
+ (alpha_procedure_type == PT_STACK ? 48 : 0))
+ ALPHA_ROUND (frame_size
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
else
- frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
+ frame_size = (ALPHA_ROUND (crtl->outgoing_args_size)
+ sa_size
+ ALPHA_ROUND (frame_size
- + current_function_pretend_args_size));
+ + crtl->args.pretend_args_size));
if (TARGET_ABI_OPEN_VMS)
reg_offset = 8;
else
- reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
+ reg_offset = ALPHA_ROUND (crtl->outgoing_args_size);
alpha_sa_mask (&imask, &fmask);
}
/* Set up offsets to alpha virtual arg/local debugging pointer. */
- alpha_auto_offset = -frame_size + current_function_pretend_args_size;
+ alpha_auto_offset = -frame_size + crtl->args.pretend_args_size;
alpha_arg_offset = -frame_size + 48;
/* Describe our frame. If the frame size is larger than an integer,
(frame_pointer_needed
? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM),
frame_size >= max_frame_size ? 0 : frame_size,
- current_function_pretend_args_size);
+ crtl->args.pretend_args_size);
/* Describe which registers were spilled. */
if (TARGET_ABI_UNICOSMK)
frame_size = ALPHA_ROUND (sa_size
+ (alpha_procedure_type == PT_STACK ? 8 : 0)
+ frame_size
- + current_function_pretend_args_size);
+ + crtl->args.pretend_args_size);
else if (TARGET_ABI_UNICOSMK)
frame_size = ALPHA_ROUND (sa_size
+ (alpha_procedure_type == PT_STACK ? 48 : 0))
+ ALPHA_ROUND (frame_size
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
else
- frame_size = (ALPHA_ROUND (current_function_outgoing_args_size)
+ frame_size = (ALPHA_ROUND (crtl->outgoing_args_size)
+ sa_size
+ ALPHA_ROUND (frame_size
- + current_function_pretend_args_size));
+ + crtl->args.pretend_args_size));
if (TARGET_ABI_OPEN_VMS)
{
reg_offset = 0;
}
else
- reg_offset = ALPHA_ROUND (current_function_outgoing_args_size);
+ reg_offset = ALPHA_ROUND (crtl->outgoing_args_size);
alpha_sa_mask (&imask, &fmask);
else if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return 0;
else if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
- return (ALPHA_ROUND (current_function_outgoing_args_size)
+ return (ALPHA_ROUND (crtl->outgoing_args_size)
+ ALPHA_ROUND (get_frame_size()));
else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return (ALPHA_ROUND (fixed_size)
+ ALPHA_ROUND (get_frame_size()
- + current_function_outgoing_args_size));
+ + crtl->outgoing_args_size));
else
gcc_unreachable ();
}
/* Define this if the maximum size of all the outgoing args is to be
accumulated and pushed during the prologue. The amount can be
- found in the variable current_function_outgoing_args_size. */
+ found in the variable crtl->outgoing_args_size. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Offset of first parameter from the argument pointer register value. */
#define EH_RETURN_STACKADJ_RTX gen_rtx_REG (Pmode, 28)
#define EH_RETURN_HANDLER_RTX \
gen_rtx_MEM (Pmode, plus_constant (stack_pointer_rtx, \
- current_function_outgoing_args_size))
+ crtl->outgoing_args_size))
\f
/* Addressing modes, and classification of registers for them. */
&& INTVAL (operands[2])
< (0x7fff8000
- FIRST_PSEUDO_REGISTER * UNITS_PER_WORD
- - ALPHA_ROUND(current_function_outgoing_args_size)
+ - ALPHA_ROUND(crtl->outgoing_args_size)
- (ALPHA_ROUND (get_frame_size ()
+ max_reg_num () * UNITS_PER_WORD
- + current_function_pretend_args_size)
- - current_function_pretend_args_size))"
+ + crtl->args.pretend_args_size)
+ - crtl->args.pretend_args_size))"
"@
lda %0,%2(%1)
ldah %0,%h2(%1)
case ARG_POINTER_REGNUM: \
(OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \
+ get_frame_size () \
- + current_function_pretend_args_size) \
- - current_function_pretend_args_size); \
+ + crtl->args.pretend_args_size) \
+ - crtl->args.pretend_args_size); \
break; \
default: \
gcc_unreachable (); \
} \
if ((TO) == STACK_POINTER_REGNUM) \
- (OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \
+ (OFFSET) += ALPHA_ROUND (crtl->outgoing_args_size); \
}
\f
/* Define a data type for recording info about an argument list
int interrupt_p;
var_size = size;
- args_size = current_function_outgoing_args_size;
- pretend_size = current_function_pretend_args_size;
+ args_size = crtl->outgoing_args_size;
+ pretend_size = crtl->args.pretend_args_size;
extra_size = FIRST_PARM_OFFSET (0);
total_size = extra_size + pretend_size + args_size + var_size;
- reg_offset = FIRST_PARM_OFFSET(0) + current_function_outgoing_args_size;
+ reg_offset = FIRST_PARM_OFFSET(0) + crtl->outgoing_args_size;
reg_size = 0;
gmask = 0;
arc_va_start (tree valist, rtx nextarg)
{
/* See arc_setup_incoming_varargs for reasons for this oddity. */
- if (current_function_args_info < 8
- && (current_function_args_info & 1))
+ if (crtl->args.info < 8
+ && (crtl->args.info & 1))
nextarg = plus_constant (nextarg, UNITS_PER_WORD);
std_expand_builtin_va_start (valist, nextarg);
/* If defined, the maximum amount of space required for outgoing
arguments will be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed
+ `crtl->outgoing_args_size'. No space will be pushed
onto the stack for each call; instead, the function prologue should
increase the stack frame size by this amount. */
#define ACCUMULATE_OUTGOING_ARGS 1
stack_adjust = offsets->outgoing_args - offsets->saved_regs;
/* As do variadic functions. */
- if (current_function_pretend_args_size
+ if (crtl->args.pretend_args_size
|| cfun->machine->uses_anonymous_args
/* Or if the function calls __builtin_eh_return () */
|| current_function_calls_eh_return
the variable argument list and so we can be sure that it will be
pushed right at the start of the function. Hence it will be available
for the rest of the prologue.
- (*): ie current_function_pretend_args_size is greater than 0. */
+ (*): ie crtl->args.pretend_args_size is greater than 0. */
if (cfun->machine->uses_anonymous_args
- && current_function_pretend_args_size > 0)
+ && crtl->args.pretend_args_size > 0)
return LAST_ARG_REGNUM;
/* The other case is when we have fixed arguments but less than 4 registers
worth. In this case r3 might be used in the body of the function, but
it is not being used to convey an argument into the function. In theory
- we could just check current_function_args_size to see how many bytes are
+ we could just check crtl->args.size to see how many bytes are
being passed in argument registers, but it seems that it is unreliable.
Sometimes it will have the value 0 when in fact arguments are being
passed. (See testcase execute/20021111-1.c for an example). So we also
when a function has an unused argument in r3. But it is better to be
safe than to be sorry. */
if (! cfun->machine->uses_anonymous_args
- && current_function_args_size >= 0
- && current_function_args_size <= (LAST_ARG_REGNUM * UNITS_PER_WORD)
+ && crtl->args.size >= 0
+ && crtl->args.size <= (LAST_ARG_REGNUM * UNITS_PER_WORD)
&& cfun->args_info.nregs < 4)
return LAST_ARG_REGNUM;
if (TARGET_REALLY_IWMMXT
&& ((bit_count (save_reg_mask)
- + ARM_NUM_INTS (current_function_pretend_args_size)) % 2) != 0)
+ + ARM_NUM_INTS (crtl->args.pretend_args_size)) % 2) != 0)
{
/* The total number of registers that are going to be pushed
onto the stack is odd. We need to ensure that the stack
asm_fprintf (f, "\t%@ Stack Align: May be called with mis-aligned SP.\n");
asm_fprintf (f, "\t%@ args = %d, pretend = %d, frame = %wd\n",
- current_function_args_size,
- current_function_pretend_args_size, frame_size);
+ crtl->args.size,
+ crtl->args.pretend_args_size, frame_size);
asm_fprintf (f, "\t%@ frame_needed = %d, uses_anonymous_args = %d\n",
frame_pointer_needed,
&& (TARGET_ARM || ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL)
&& !IS_STACKALIGN (func_type)
&& really_return
- && current_function_pretend_args_size == 0
+ && crtl->args.pretend_args_size == 0
&& saved_regs_mask & (1 << LR_REGNUM)
&& !current_function_calls_eh_return)
{
print_multi_reg (f, "pop\t", SP_REGNUM, saved_regs_mask, 0);
}
- if (current_function_pretend_args_size)
+ if (crtl->args.pretend_args_size)
{
/* Unwind the pre-pushed regs. */
operands[0] = operands[1] = stack_pointer_rtx;
- operands[2] = GEN_INT (current_function_pretend_args_size);
+ operands[2] = GEN_INT (crtl->args.pretend_args_size);
output_add_immediate (operands);
}
}
{
enum machine_mode mode;
- if (current_function_return_rtx != 0)
- mode = GET_MODE (current_function_return_rtx);
+ if (crtl->return_rtx != 0)
+ mode = GET_MODE (crtl->return_rtx);
else
mode = DECL_MODE (DECL_RESULT (current_function_decl));
leaf = leaf_function_p ();
/* Space for variadic functions. */
- offsets->saved_args = current_function_pretend_args_size;
+ offsets->saved_args = crtl->args.pretend_args_size;
/* In Thumb mode this is incorrect, but never used. */
offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0);
/* Try to align stack by pushing an extra reg. Don't bother doing this
when there is a stack frame as the alignment will be rolled into
the normal stack adjustment. */
- if (frame_size + current_function_outgoing_args_size == 0)
+ if (frame_size + crtl->outgoing_args_size == 0)
{
int reg = -1;
offsets->locals_base = offsets->soft_frame + frame_size;
offsets->outgoing_args = (offsets->locals_base
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
if (ARM_DOUBLEWORD_ALIGN)
{
return;
/* Make a copy of c_f_p_a_s as we may need to modify it locally. */
- args_to_push = current_function_pretend_args_size;
+ args_to_push = crtl->args.pretend_args_size;
/* Compute which register we will have to save onto the stack. */
offsets = arm_get_frame_offsets ();
if (!df_regs_ever_live_p (3)
|| saved_pretend_args)
insn = gen_rtx_REG (SImode, 3);
- else /* if (current_function_pretend_args_size == 0) */
+ else /* if (crtl->args.pretend_args_size == 0) */
{
insn = plus_constant (hard_frame_pointer_rtx, 4);
insn = gen_frame_mem (SImode, insn);
ever used in the function, not just if the register is used
to hold a return value. */
- if (current_function_return_rtx != 0)
- mode = GET_MODE (current_function_return_rtx);
+ if (crtl->return_rtx != 0)
+ mode = GET_MODE (crtl->return_rtx);
else
mode = DECL_MODE (DECL_RESULT (current_function_decl));
had_to_push_lr = (live_regs_mask & (1 << LR_REGNUM)) != 0;
live_regs_mask &= 0xff;
- if (current_function_pretend_args_size == 0 || TARGET_BACKTRACE)
+ if (crtl->args.pretend_args_size == 0 || TARGET_BACKTRACE)
{
/* Pop the return address into the PC. */
if (had_to_push_lr)
/* Remove the argument registers that were pushed onto the stack. */
asm_fprintf (asm_out_file, "\tadd\t%r, %r, #%d\n",
SP_REGNUM, SP_REGNUM,
- current_function_pretend_args_size);
+ crtl->args.pretend_args_size);
thumb_exit (asm_out_file, regno);
}
asm_fprintf (f, "%s%U%s:\n", STUB_NAME, name);
}
- if (current_function_pretend_args_size)
+ if (crtl->args.pretend_args_size)
{
/* Output unwind directive for the stack adjustment. */
if (ARM_EABI_UNWIND_TABLES)
fprintf (f, "\t.pad #%d\n",
- current_function_pretend_args_size);
+ crtl->args.pretend_args_size);
if (cfun->machine->uses_anonymous_args)
{
fprintf (f, "\tpush\t{");
- num_pushes = ARM_NUM_INTS (current_function_pretend_args_size);
+ num_pushes = ARM_NUM_INTS (crtl->args.pretend_args_size);
for (regno = LAST_ARG_REGNUM + 1 - num_pushes;
regno <= LAST_ARG_REGNUM;
else
asm_fprintf (f, "\tsub\t%r, %r, #%d\n",
SP_REGNUM, SP_REGNUM,
- current_function_pretend_args_size);
+ crtl->args.pretend_args_size);
/* We don't need to record the stores for unwinding (would it
help the debugger any if we did?), but record the change in
{
char *l = dwarf2out_cfi_label ();
- cfa_offset = cfa_offset + current_function_pretend_args_size;
+ cfa_offset = cfa_offset + crtl->args.pretend_args_size;
dwarf2out_def_cfa (l, SP_REGNUM, cfa_offset);
}
}
offset = 0;
asm_fprintf (f, "\tadd\t%r, %r, #%d\n", work_register, SP_REGNUM,
- offset + 16 + current_function_pretend_args_size);
+ offset + 16 + crtl->args.pretend_args_size);
asm_fprintf (f, "\tstr\t%r, [%r, #%d]\n", work_register, SP_REGNUM,
offset + 4);
couldn't convert a direct call into an indirect one. */
#define CALLER_INTERWORKING_SLOT_SIZE \
(TARGET_CALLER_INTERWORKING \
- && current_function_outgoing_args_size != 0 \
+ && crtl->outgoing_args_size != 0 \
? UNITS_PER_WORD : 0)
/* Offset within stack frame to start allocating local variables at.
/* Define this if the maximum size of all the outgoing args is to be
accumulated and pushed during the prologue. The amount can be
- found in the variable current_function_outgoing_args_size. */
+ found in the variable crtl->outgoing_args_size. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Offset of first parameter from the argument pointer register value. */
frame_pointer_required_p (void)
{
return (current_function_calls_alloca
- || current_function_args_info.nregs == 0
+ || crtl->args.info.nregs == 0
|| get_frame_size () > 0);
}
if (to == STACK_POINTER_REGNUM)
{
- if (current_function_outgoing_args_size >= FIXED_STACK_AREA)
- offset += current_function_outgoing_args_size;
- else if (current_function_outgoing_args_size)
+ if (crtl->outgoing_args_size >= FIXED_STACK_AREA)
+ offset += crtl->outgoing_args_size;
+ else if (crtl->outgoing_args_size)
offset += FIXED_STACK_AREA;
offset += get_frame_size ();
static HOST_WIDE_INT
arg_area_size (void)
{
- if (current_function_outgoing_args_size)
+ if (crtl->outgoing_args_size)
{
- if (current_function_outgoing_args_size >= FIXED_STACK_AREA)
- return current_function_outgoing_args_size;
+ if (crtl->outgoing_args_size >= FIXED_STACK_AREA)
+ return crtl->outgoing_args_size;
else
return FIXED_STACK_AREA;
}
/* Define this if the maximum size of all the outgoing args is to be
accumulated and pushed during the prologue. The amount can be
- found in the variable current_function_outgoing_args_size. */
+ found in the variable crtl->outgoing_args_size. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Value should be nonzero if functions must have frame pointers.
offs += get_frame_size ();
/* And more; the accumulated args size. */
- offs += current_function_outgoing_args_size;
+ offs += crtl->outgoing_args_size;
/* Then round it off, in case we use aligned stack. */
if (TARGET_STACK_ALIGN)
if (! reload_completed
|| frame_pointer_needed
|| get_frame_size () != 0
- || current_function_pretend_args_size
- || current_function_args_size
- || current_function_outgoing_args_size
+ || crtl->args.pretend_args_size
+ || crtl->args.size
+ || crtl->outgoing_args_size
|| current_function_calls_eh_return
/* If we're not supposed to emit prologue and epilogue, we must
int regno;
int size = get_frame_size ();
/* Shorten the used name for readability. */
- int cfoa_size = current_function_outgoing_args_size;
+ int cfoa_size = crtl->outgoing_args_size;
int last_movem_reg = -1;
int framesize = 0;
rtx mem, insn;
int return_address_on_stack = cris_return_address_on_stack ();
int got_really_used = false;
int n_movem_regs = 0;
- int pretend = current_function_pretend_args_size;
+ int pretend = crtl->args.pretend_args_size;
/* Don't do anything if no prologues or epilogues are wanted. */
if (!TARGET_PROLOGUE_EPILOGUE)
{
/* See also cris_setup_incoming_varargs where
cfun->machine->stdarg_regs is set. There are other setters of
- current_function_pretend_args_size than stdarg handling, like
+ crtl->args.pretend_args_size than stdarg handling, like
for an argument passed with parts in R13 and stack. We must
not store R13 into the pretend-area for that case, as GCC does
that itself. "Our" store would be marked as redundant and GCC
get confused. */
}
- /* For other setters of current_function_pretend_args_size, we
+ /* For other setters of crtl->args.pretend_args_size, we
just adjust the stack by leaving the remaining size in
"pretend", handled below. */
}
int regno;
int size = get_frame_size ();
int last_movem_reg = -1;
- int argspace_offset = current_function_outgoing_args_size;
- int pretend = current_function_pretend_args_size;
+ int argspace_offset = crtl->outgoing_args_size;
+ int pretend = crtl->args.pretend_args_size;
rtx mem;
bool return_address_on_stack = cris_return_address_on_stack ();
/* A reference may have been optimized out
local_vars_size += padding_locals;
size_for_adjusting_sp = local_vars_size + (ACCUMULATE_OUTGOING_ARGS ?
- current_function_outgoing_args_size : 0);
+ crtl->outgoing_args_size : 0);
}
/* Implements the macro INITIAL_ELIMINATION_OFFSET, return the OFFSET. */
if ((from) == FRAME_POINTER_REGNUM && (to) == STACK_POINTER_REGNUM)
return (ACCUMULATE_OUTGOING_ARGS ?
- current_function_outgoing_args_size : 0);
+ crtl->outgoing_args_size : 0);
else if ((from) == ARG_POINTER_REGNUM && (to) == FRAME_POINTER_REGNUM)
return (sum_regs + local_vars_size);
else if ((from) == ARG_POINTER_REGNUM && (to) == STACK_POINTER_REGNUM)
return (sum_regs + local_vars_size +
(ACCUMULATE_OUTGOING_ARGS ?
- current_function_outgoing_args_size : 0));
+ crtl->outgoing_args_size : 0));
else
abort ();
}
unsigned int gmask;
var_size = WORD_ALIGN (get_frame_size ());
- args_size = WORD_ALIGN (current_function_outgoing_args_size);
- pretend_size = current_function_pretend_args_size;
+ args_size = WORD_ALIGN (crtl->outgoing_args_size);
+ pretend_size = crtl->args.pretend_args_size;
reg_size = 0;
gmask = 0;
register. See `FIXED_REGISTERS' for more information. */
/* #define FRAME_POINTER_REQUIRED 0 */
#define FRAME_POINTER_REQUIRED \
- (flag_omit_frame_pointer == 0 || current_function_pretend_args_size > 0)
+ (flag_omit_frame_pointer == 0 || crtl->args.pretend_args_size > 0)
/* If defined, this macro specifies a table of register pairs used to eliminate
unneeded registers that point into the stack frame. If it is not defined,
/* If defined, the maximum amount of space required for outgoing arguments will
be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed onto the
+ `crtl->outgoing_args_size'. No space will be pushed onto the
stack for each call; instead, the function prologue should increase the
stack frame size by this amount.
/* If defined, the maximum amount of space required for outgoing arguments will
be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed onto the
+ `crtl->outgoing_args_size'. No space will be pushed onto the
stack for each call; instead, the function prologue should increase the
stack frame size by this amount.
sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
/* Count number of gp and fp argument registers used. */
- words = current_function_args_info.words;
- n_gpr = current_function_args_info.regno;
- n_fpr = current_function_args_info.sse_regno;
+ words = crtl->args.info.words;
+ n_gpr = crtl->args.info.regno;
+ n_fpr = crtl->args.info.sse_regno;
if (cfun->va_list_gpr_size)
{
/* Don't allow more than 32 pop, since that's all we can do
with one instruction. */
- if (current_function_pops_args
- && current_function_args_size >= 32768)
+ if (crtl->args.pops_args
+ && crtl->args.size >= 32768)
return 0;
ix86_compute_frame_layout (&frame);
/* Add outgoing arguments area. Can be skipped if we eliminated
all the function calls as dead code.
Skipping is however impossible when function calls alloca. Alloca
- expander assumes that last current_function_outgoing_args_size
+ expander assumes that last crtl->outgoing_args_size
of stack frame are unused. */
if (ACCUMULATE_OUTGOING_ARGS
&& (!current_function_is_leaf || current_function_calls_alloca
|| ix86_current_function_calls_tls_descriptor))
{
- offset += current_function_outgoing_args_size;
- frame->outgoing_arguments_size = current_function_outgoing_args_size;
+ offset += crtl->outgoing_args_size;
+ frame->outgoing_arguments_size = crtl->outgoing_args_size;
}
else
frame->outgoing_arguments_size = 0;
if (style == 0)
return;
- if (current_function_pops_args && current_function_args_size)
+ if (crtl->args.pops_args && crtl->args.size)
{
- rtx popc = GEN_INT (current_function_pops_args);
+ rtx popc = GEN_INT (crtl->args.pops_args);
/* i386 can only pop 64K bytes. If asked to pop more, pop
return address, do explicit add, and jump indirectly to the
caller. */
- if (current_function_pops_args >= 65536)
+ if (crtl->args.pops_args >= 65536)
{
rtx ecx = gen_rtx_REG (SImode, CX_REG);
/* If defined, the maximum amount of space required for outgoing arguments will
be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed onto the
+ `crtl->outgoing_args_size'. No space will be pushed onto the
stack for each call; instead, the function prologue should increase the stack
frame size by this amount. */
[(return)]
"ix86_can_use_return_insn_p ()"
{
- if (current_function_pops_args)
+ if (crtl->args.pops_args)
{
- rtx popc = GEN_INT (current_function_pops_args);
+ rtx popc = GEN_INT (crtl->args.pops_args);
emit_jump_insn (gen_return_pop_internal (popc));
DONE;
}
the stack, then the FR save area will be unaligned. We round the
size of this area up to keep things 16 byte aligned. */
if (spilled_fr_p)
- pretend_args_size = IA64_STACK_ALIGN (current_function_pretend_args_size);
+ pretend_args_size = IA64_STACK_ALIGN (crtl->args.pretend_args_size);
else
- pretend_args_size = current_function_pretend_args_size;
+ pretend_args_size = crtl->args.pretend_args_size;
total_size = (spill_size + extra_spill_size + size + pretend_args_size
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
total_size = IA64_STACK_ALIGN (total_size);
/* We always use the 16-byte scratch area provided by the caller, but
offset = -current_frame_info.total_size;
else
offset = -(current_frame_info.total_size
- - current_function_outgoing_args_size - 16);
+ - crtl->outgoing_args_size - 16);
break;
case STACK_POINTER_REGNUM:
if (current_function_is_leaf)
offset = 0;
else
- offset = 16 + current_function_outgoing_args_size;
+ offset = 16 + crtl->outgoing_args_size;
break;
default:
switch (to)
{
case HARD_FRAME_POINTER_REGNUM:
- offset = 16 - current_function_pretend_args_size;
+ offset = 16 - crtl->args.pretend_args_size;
break;
case STACK_POINTER_REGNUM:
offset = (current_frame_info.total_size
- + 16 - current_function_pretend_args_size);
+ + 16 - crtl->args.pretend_args_size);
break;
default:
/* We don't need an alloc instruction if we've used no outputs or locals. */
if (current_frame_info.n_local_regs == 0
&& current_frame_info.n_output_regs == 0
- && current_frame_info.n_input_regs <= current_function_args_info.int_regs
+ && current_frame_info.n_input_regs <= crtl->args.info.int_regs
&& !TEST_HARD_REG_BIT (current_frame_info.mask, AR_PFS_REGNUM))
{
/* If there is no alloc, but there are input registers used, then we
/* If defined, the maximum amount of space required for outgoing arguments will
be computed and placed into the variable
- `current_function_outgoing_args_size'. */
+ `crtl->outgoing_args_size'. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Find out how many non-float named formals. */
int gpr_save_area_size;
/* Note UNITS_PER_WORD is 4 bytes. */
- int_arg_words = current_function_args_info.arg_words;
+ int_arg_words = crtl->args.info.arg_words;
if (int_arg_words < 8 )
/* Adjust for the prologue's economy measure. */
mask = 0;
extra_size = IQ2000_STACK_ALIGN ((0));
var_size = IQ2000_STACK_ALIGN (size);
- args_size = IQ2000_STACK_ALIGN (current_function_outgoing_args_size);
+ args_size = IQ2000_STACK_ALIGN (crtl->outgoing_args_size);
/* If a function dynamically allocates the stack and
has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space. */
&& ! profile_flag)
total_size = extra_size = 0;
- total_size += IQ2000_STACK_ALIGN (current_function_pretend_args_size);
+ total_size += IQ2000_STACK_ALIGN (crtl->args.pretend_args_size);
/* Save other computed information. */
cfun->machine->total_size = total_size;
#define FRAME_GROWS_DOWNWARD 0
#define STARTING_FRAME_OFFSET \
- (current_function_outgoing_args_size)
+ (crtl->outgoing_args_size)
/* Use the default value zero. */
/* #define STACK_POINTER_OFFSET 0 */
| current_function_profile);
var_size = M32R_STACK_ALIGN (size);
- args_size = M32R_STACK_ALIGN (current_function_outgoing_args_size);
- pretend_size = current_function_pretend_args_size;
+ args_size = M32R_STACK_ALIGN (crtl->outgoing_args_size);
+ pretend_size = crtl->args.pretend_args_size;
extra_size = FIRST_PARM_OFFSET (0);
total_size = extra_size + pretend_size + args_size + var_size;
reg_size = 0;
/* The frame pointer points at the same place as the stack pointer, except if
alloca has been called. */
#define STARTING_FRAME_OFFSET \
- M32R_STACK_ALIGN (current_function_outgoing_args_size)
+ M32R_STACK_ALIGN (crtl->outgoing_args_size)
/* Offset from the stack pointer register to the first location at which
outgoing arguments are placed. */
if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
(OFFSET) = 0; \
else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
- (OFFSET) = size - current_function_pretend_args_size; \
+ (OFFSET) = size - crtl->args.pretend_args_size; \
else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
- (OFFSET) = size - current_function_pretend_args_size; \
+ (OFFSET) = size - crtl->args.pretend_args_size; \
else \
gcc_unreachable (); \
} \
/* If defined, the maximum amount of space required for outgoing
arguments will be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed
+ `crtl->outgoing_args_size'. No space will be pushed
onto the stack for each call; instead, the function prologue should
increase the stack frame size by this amount. */
#define ACCUMULATE_OUTGOING_ARGS 1
If the first argument is a 32-bit quantity, the D+X registers
are used. Use Y to compute the frame. Otherwise, X is cheaper.
For 68HC12, this scratch register is not used. */
- if (current_function_args_info.nregs == 2)
+ if (crtl->args.info.nregs == 2)
scratch = iy_reg;
else
scratch = ix_reg;
/* If we are returning a value in two registers, we have to preserve the
X register and use the Y register to restore the stack and the saved
registers. Otherwise, use X because it's faster (and smaller). */
- if (current_function_return_rtx == 0)
+ if (crtl->return_rtx == 0)
return_size = 0;
- else if (GET_CODE (current_function_return_rtx) == MEM)
+ else if (GET_CODE (crtl->return_rtx) == MEM)
return_size = HARD_REG_SIZE;
else
- return_size = GET_MODE_SIZE (GET_MODE (current_function_return_rtx));
+ return_size = GET_MODE_SIZE (GET_MODE (crtl->return_rtx));
if (return_size > HARD_REG_SIZE && return_size <= 2 * HARD_REG_SIZE)
scratch = iy_reg;
{
int ret_size = 0;
- if (current_function_return_rtx)
- ret_size = GET_MODE_SIZE (GET_MODE (current_function_return_rtx));
+ if (crtl->return_rtx)
+ ret_size = GET_MODE_SIZE (GET_MODE (crtl->return_rtx));
/* Emit use notes only when HAVE_return is true. */
if (m68hc11_total_frame_size () != 0)
{
int ret_size = 0;
- if (current_function_return_rtx)
- ret_size = GET_MODE_SIZE (GET_MODE (current_function_return_rtx));
+ if (crtl->return_rtx)
+ ret_size = GET_MODE_SIZE (GET_MODE (crtl->return_rtx));
if (ret_size == 0)
return \"jmp\\t__return_void\";
return "sleep";
default:
- if (current_function_pops_args)
+ if (crtl->args.pops_args)
{
- operands[0] = GEN_INT (current_function_pops_args);
+ operands[0] = GEN_INT (crtl->args.pops_args);
return "rtd %0";
}
else
/* Might have to spill bytes to re-assemble a big argument that
was passed partially in registers and partially on the stack. */
- nbytes = current_function_pretend_args_size;
+ nbytes = crtl->args.pretend_args_size;
/* Determine how much space for spilled anonymous args (e.g., stdarg). */
if (current_function_anonymous_args)
/* And the rest of it... locals and space for overflowed outbounds. */
infp->local_size = get_frame_size ();
- infp->outbound_size = current_function_outgoing_args_size;
+ infp->outbound_size = crtl->outgoing_args_size;
/* Make sure we have a whole number of words for the locals. */
if (infp->local_size % STACK_BYTES)
/* If we have a parameter passed partially in regs and partially in memory,
the registers will have been stored to memory already in function.c. So
we only need to do something here for varargs functions. */
- if (fi.arg_size != 0 && current_function_pretend_args_size == 0)
+ if (fi.arg_size != 0 && crtl->args.pretend_args_size == 0)
{
int offset;
int rn = FIRST_PARM_REG + NPARM_REGS - 1;
/* If defined, the maximum amount of space required for outgoing arguments
will be computed and placed into the variable
- `current_function_outgoing_args_size'. No space will be pushed
+ `crtl->outgoing_args_size'. No space will be pushed
onto the stack for each call; instead, the function prologue should
increase the stack frame size by this amount. */
#define ACCUMULATE_OUTGOING_ARGS 1
int fpr_save_area_size;
int fpr_offset;
- cum = ¤t_function_args_info;
+ cum = &crtl->args.info;
gpr_save_area_size
= (MAX_ARGS_IN_REGISTERS - cum->num_gprs) * UNITS_PER_WORD;
fpr_save_area_size
fprintf (asm_out_file, "\t# Stub function for %s (",
current_function_name ());
separator = "";
- for (f = (unsigned int) current_function_args_info.fp_code; f != 0; f >>= 2)
+ for (f = (unsigned int) crtl->args.info.fp_code; f != 0; f >>= 2)
{
fprintf (asm_out_file, "%s%s", separator,
(f & 3) == 1 ? "float" : "double");
fprintf (asm_out_file, "\n");
/* Move the arguments from floating-point registers to general registers. */
- mips_output_args_xfer (current_function_args_info.fp_code, 'f');
+ mips_output_args_xfer (crtl->args.info.fp_code, 'f');
/* Jump to the MIPS16 function. */
fprintf (asm_out_file, "\tjr\t%s\n", reg_names[GP_REG_FIRST + 1]);
}
else
{
- frame->args_size = current_function_outgoing_args_size;
+ frame->args_size = crtl->outgoing_args_size;
frame->cprestore_size = STARTING_FRAME_OFFSET - frame->args_size;
}
offset = frame->args_size + frame->cprestore_size;
frame->arg_pointer_offset = offset;
/* Move above the callee-allocated area for pretend stack arguments. */
- offset += current_function_pretend_args_size;
+ offset += crtl->args.pretend_args_size;
frame->total_size = offset;
/* Work out the offsets of the save areas from the top of the frame. */
base = frame_pointer_needed ? hard_frame_pointer_rtx : stack_pointer_rtx;
address = mips_add_offset (pic_offset_table_rtx, base,
- current_function_outgoing_args_size);
+ crtl->outgoing_args_size);
mips_emit_move (pic_offset_table_rtx, gen_frame_mem (Pmode, address));
if (!TARGET_EXPLICIT_RELOCS)
emit_insn (gen_blockage ());
floating-point arguments. */
if (TARGET_MIPS16
&& TARGET_HARD_FLOAT_ABI
- && current_function_args_info.fp_code != 0)
+ && crtl->args.info.fp_code != 0)
mips16_build_function_stub ();
/* Select the MIPS16 mode for this function. */
/* Initialize the $gp save slot. */
if (frame->cprestore_size > 0)
- emit_insn (gen_cprestore (GEN_INT (current_function_outgoing_args_size)));
+ emit_insn (gen_cprestore (GEN_INT (crtl->outgoing_args_size)));
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. */
See mips_compute_frame_info for details about the frame layout. */
#define STARTING_FRAME_OFFSET \
- (current_function_outgoing_args_size \
+ (crtl->outgoing_args_size \
+ (TARGET_CALL_CLOBBERED_GP ? MIPS_STACK_ALIGN (UNITS_PER_WORD) : 0))
#define RETURN_ADDR_RTX mips_return_addr
allocate the area reserved for arguments passed in registers.
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
of this macro is to determine whether the space is included in
- `current_function_outgoing_args_size'. */
+ `crtl->outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE 1
#define STACK_BOUNDARY (TARGET_NEWABI ? 128 : 64)
/* The %d in "POP %d,0". */
#define MMIX_POP_ARGUMENT() \
((! TARGET_ABI_GNU \
- && current_function_return_rtx != NULL \
+ && crtl->return_rtx != NULL \
&& ! current_function_returns_struct) \
- ? (GET_CODE (current_function_return_rtx) == PARALLEL \
- ? GET_NUM_ELEM (XVEC (current_function_return_rtx, 0)) : 1) \
+ ? (GET_CODE (crtl->return_rtx) == PARALLEL \
+ ? GET_NUM_ELEM (XVEC (crtl->return_rtx, 0)) : 1) \
: 0)
/* The canonical saved comparison operands for non-cc0 machines, set in
{
int regno;
int fp_sp_offset
- = (get_frame_size () + current_function_outgoing_args_size + 7) & ~7;
+ = (get_frame_size () + crtl->outgoing_args_size + 7) & ~7;
/* There is no actual offset between these two virtual values, but for
the frame-pointer, we have the old one in the stack position below
wasteful to optimize for unused parameter registers. As of
2002-04-30, df_regs_ever_live_p (n) seems to be set for only-reads too, but
that might change. */
- if (!TARGET_ABI_GNU && regno < current_function_args_info.regs - 1)
+ if (!TARGET_ABI_GNU && regno < crtl->args.info.regs - 1)
{
- regno = current_function_args_info.regs - 1;
+ regno = crtl->args.info.regs - 1;
/* We don't want to let this cause us to go over the limit and make
incoming parameter registers be misnumbered and treating the last
int regno;
int stack_space_to_allocate
- = (current_function_outgoing_args_size
- + current_function_pretend_args_size
+ = (crtl->outgoing_args_size
+ + crtl->args.pretend_args_size
+ get_frame_size () + 7) & ~7;
if (!TARGET_USE_RETURN_INSN || !reload_completed)
HOST_WIDE_INT locals_size = get_frame_size ();
int regno;
HOST_WIDE_INT stack_space_to_allocate
- = (current_function_outgoing_args_size
- + current_function_pretend_args_size
+ = (crtl->outgoing_args_size
+ + crtl->args.pretend_args_size
+ locals_size + 7) & ~7;
HOST_WIDE_INT offset = -8;
internal_error ("stack frame not a multiple of 8 bytes: %wd",
stack_space_to_allocate);
- if (current_function_pretend_args_size)
+ if (crtl->args.pretend_args_size)
{
int mmix_first_vararg_reg
= (MMIX_FIRST_INCOMING_ARG_REGNUM
+ (MMIX_MAX_ARGS_IN_REGS
- - current_function_pretend_args_size / 8));
+ - crtl->args.pretend_args_size / 8));
for (regno
= MMIX_FIRST_INCOMING_ARG_REGNUM + MMIX_MAX_ARGS_IN_REGS - 1;
HOST_WIDE_INT locals_size = get_frame_size ();
int regno;
HOST_WIDE_INT stack_space_to_deallocate
- = (current_function_outgoing_args_size
- + current_function_pretend_args_size
+ = (crtl->outgoing_args_size
+ + crtl->args.pretend_args_size
+ locals_size + 7) & ~7;
/* The first address to access is beyond the outgoing_args area. */
- HOST_WIDE_INT offset = current_function_outgoing_args_size;
+ HOST_WIDE_INT offset = crtl->outgoing_args_size;
/* Add the space for global non-register-stack registers.
It is assumed that the frame-pointer register can be one of these
can_use_return_insn (void)
{
/* size includes the fixed stack space needed for function calls. */
- int size = get_frame_size () + current_function_outgoing_args_size;
+ int size = get_frame_size () + crtl->outgoing_args_size;
/* And space for the return pointer. */
- size += current_function_outgoing_args_size ? 4 : 0;
+ size += crtl->outgoing_args_size ? 4 : 0;
return (reload_completed
&& size == 0
HOST_WIDE_INT size;
/* SIZE includes the fixed stack space needed for function calls. */
- size = get_frame_size () + current_function_outgoing_args_size;
- size += (current_function_outgoing_args_size ? 4 : 0);
+ size = get_frame_size () + crtl->outgoing_args_size;
+ size += (crtl->outgoing_args_size ? 4 : 0);
/* If we use any of the callee-saved registers, save them now. */
mn10300_gen_multiple_store (mn10300_get_live_callee_saved_regs ());
HOST_WIDE_INT size;
/* SIZE includes the fixed stack space needed for function calls. */
- size = get_frame_size () + current_function_outgoing_args_size;
- size += (current_function_outgoing_args_size ? 4 : 0);
+ size = get_frame_size () + crtl->outgoing_args_size;
+ size += (crtl->outgoing_args_size ? 4 : 0);
if (TARGET_AM33_2 && fp_regs_to_save ())
{
|| frame_pointer_needed)
return (get_frame_size () + REG_SAVE_BYTES
+ 4 * fp_regs_to_save ()
- + (current_function_outgoing_args_size
- ? current_function_outgoing_args_size + 4 : 0));
+ + (crtl->outgoing_args_size
+ ? crtl->outgoing_args_size + 4 : 0));
else
return (get_frame_size ()
- + (current_function_outgoing_args_size
- ? current_function_outgoing_args_size + 4 : 0));
+ + (crtl->outgoing_args_size
+ ? crtl->outgoing_args_size + 4 : 0));
}
/* The difference between the frame pointer and stack pointer is the sum
for function calls (if any). */
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return (get_frame_size ()
- + (current_function_outgoing_args_size
- ? current_function_outgoing_args_size + 4 : 0));
+ + (crtl->outgoing_args_size
+ ? crtl->outgoing_args_size + 4 : 0));
gcc_unreachable ();
}
alias_set_type set = get_varargs_alias_set ();
if (argadj)
- offset = plus_constant (current_function_arg_offset_rtx, argadj);
+ offset = plus_constant (crtl->args.arg_offset_rtx, argadj);
else
- offset = current_function_arg_offset_rtx;
+ offset = crtl->args.arg_offset_rtx;
- mem = gen_rtx_MEM (SImode, current_function_internal_arg_pointer);
+ mem = gen_rtx_MEM (SImode, crtl->args.internal_arg_pointer);
set_mem_alias_set (mem, set);
emit_move_insn (mem, gen_rtx_REG (SImode, 0));
mem = gen_rtx_MEM (SImode,
- plus_constant (current_function_internal_arg_pointer, 4));
+ plus_constant (crtl->args.internal_arg_pointer, 4));
set_mem_alias_set (mem, set);
emit_move_insn (mem, gen_rtx_REG (SImode, 1));
return copy_to_reg (expand_binop (Pmode, add_optab,
- current_function_internal_arg_pointer,
+ crtl->args.internal_arg_pointer,
offset, 0, 0, OPTAB_LIB_WIDEN));
}
{
rtx sp_reg = gen_rtx_REG (SImode, SP_REG);
int need_stack_space = (get_frame_size () == 0
- && current_function_outgoing_args_size == 0);
+ && crtl->outgoing_args_size == 0);
if (need_stack_space)
emit_move_insn (sp_reg, plus_constant (sp_reg, -4));
unsigned int reg_mask;
var_size = size;
- args_size = current_function_outgoing_args_size;
- pretend_size = current_function_pretend_args_size;
+ args_size = crtl->outgoing_args_size;
+ pretend_size = crtl->args.pretend_args_size;
extra_size = FIRST_PARM_OFFSET (0);
total_size = extra_size + pretend_size + args_size + var_size;
reg_size = 0;
subtracting the first slot's length from `STARTING_FRAME_OFFSET'.
Otherwise, it is found by adding the length of the first slot to
the value `STARTING_FRAME_OFFSET'. */
-#define STARTING_FRAME_OFFSET current_function_outgoing_args_size
+#define STARTING_FRAME_OFFSET crtl->outgoing_args_size
/* Offset from the argument pointer register to the first argument's address.
On some machines it may depend on the data type of the function.
/* If defined, the maximum amount of space required for outgoing
arguments will be computed and placed into the variable
- `current_function_outgoing_args_size'. */
+ `crtl->outgoing_args_size'. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Define this if it is the responsibility of the caller to
size of the current function's stack frame. We don't need to align
for the outgoing arguments as their alignment is set by the final
rounding for the frame as a whole. */
- size += current_function_outgoing_args_size;
+ size += crtl->outgoing_args_size;
/* Allocate space for the fixed frame marker. This space must be
allocated for any function that makes calls or allocates
? UNITS_PER_WORD : 0);
if (argadj)
- offset = plus_constant (current_function_arg_offset_rtx, argadj);
+ offset = plus_constant (crtl->args.arg_offset_rtx, argadj);
else
- offset = current_function_arg_offset_rtx;
+ offset = crtl->args.arg_offset_rtx;
if (TARGET_64BIT)
{
/* Adjust for varargs/stdarg differences. */
if (argadj)
- offset = plus_constant (current_function_arg_offset_rtx, -argadj);
+ offset = plus_constant (crtl->args.arg_offset_rtx, -argadj);
else
- offset = current_function_arg_offset_rtx;
+ offset = crtl->args.arg_offset_rtx;
/* We need to save %r26 .. %r19 inclusive starting at offset -64
from the incoming arg pointer and growing to larger addresses. */
/* Store general registers on the stack. */
dest = gen_rtx_MEM (BLKmode,
- plus_constant (current_function_internal_arg_pointer,
+ plus_constant (crtl->args.internal_arg_pointer,
-16));
set_mem_alias_set (dest, get_varargs_alias_set ());
set_mem_align (dest, BITS_PER_WORD);
emit_insn (gen_blockage ());
return copy_to_reg (expand_binop (Pmode, add_optab,
- current_function_internal_arg_pointer,
+ crtl->args.internal_arg_pointer,
offset, 0, 0, OPTAB_LIB_WIDEN));
}
marker, although the runtime documentation only describes a 16
byte marker. For compatibility, we allocate 48 bytes. */
#define STACK_POINTER_OFFSET \
- (TARGET_64BIT ? -(current_function_outgoing_args_size + 48): -32)
+ (TARGET_64BIT ? -(crtl->outgoing_args_size + 48): -32)
#define STACK_DYNAMIC_OFFSET(FNDECL) \
(TARGET_64BIT \
? (STACK_POINTER_OFFSET) \
- : ((STACK_POINTER_OFFSET) - current_function_outgoing_args_size))
+ : ((STACK_POINTER_OFFSET) - crtl->outgoing_args_size))
/* Value is 1 if returning from a function call automatically
pops the arguments described by the number-of-args field in the call.
#define EXIT_IGNORE_STACK \
(get_frame_size () != 0 \
- || current_function_calls_alloca || current_function_outgoing_args_size)
+ || current_function_calls_alloca || crtl->outgoing_args_size)
/* Output assembler code for a block containing the constant parts
of a trampoline, leaving space for the variable parts.\
the only method that we have for doing DImode multiplication
is with a libcall. This could be trouble if we haven't
allocated enough space for the outgoing arguments. */
- gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size);
+ gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
emit_move_insn (arg_pointer_rtx,
gen_rtx_PLUS (word_mode, stack_pointer_rtx,
the only method that we have for doing DImode multiplication
is with a libcall. This could be trouble if we haven't
allocated enough space for the outgoing arguments. */
- gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size);
+ gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
emit_move_insn (arg_pointer_rtx,
gen_rtx_PLUS (word_mode, stack_pointer_rtx,
the only method that we have for doing DImode multiplication
is with a libcall. This could be trouble if we haven't
allocated enough space for the outgoing arguments. */
- gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size);
+ gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
emit_move_insn (arg_pointer_rtx,
gen_rtx_PLUS (word_mode, stack_pointer_rtx,
the only method that we have for doing DImode multiplication
is with a libcall. This could be trouble if we haven't
allocated enough space for the outgoing arguments. */
- gcc_assert (INTVAL (nb) <= current_function_outgoing_args_size);
+ gcc_assert (INTVAL (nb) <= crtl->outgoing_args_size);
emit_move_insn (arg_pointer_rtx,
gen_rtx_PLUS (word_mode, stack_pointer_rtx,
#define STARTING_FRAME_OFFSET \
(FRAME_GROWS_DOWNWARD \
? 0 \
- : (RS6000_ALIGN (current_function_outgoing_args_size, 16) \
+ : (RS6000_ALIGN (crtl->outgoing_args_size, 16) \
+ RS6000_SAVE_AREA))
#undef STACK_DYNAMIC_OFFSET
#define STACK_DYNAMIC_OFFSET(FUNDECL) \
- (RS6000_ALIGN (current_function_outgoing_args_size, 16) \
+ (RS6000_ALIGN (crtl->outgoing_args_size, 16) \
+ (STACK_POINTER_OFFSET))
/* These are used by -fbranch-probabilities */
sav = build3 (COMPONENT_REF, TREE_TYPE (f_sav), valist, f_sav, NULL_TREE);
/* Count number of gp and fp argument registers used. */
- words = current_function_args_info.words;
- n_gpr = MIN (current_function_args_info.sysv_gregno - GP_ARG_MIN_REG,
+ words = crtl->args.info.words;
+ n_gpr = MIN (crtl->args.info.sysv_gregno - GP_ARG_MIN_REG,
GP_ARG_NUM_REG);
- n_fpr = MIN (current_function_args_info.fregno - FP_ARG_MIN_REG,
+ n_fpr = MIN (crtl->args.info.fregno - FP_ARG_MIN_REG,
FP_ARG_NUM_REG);
if (TARGET_DEBUG_ARG)
them in again. More importantly, the mask we compute here is
used to generate CLOBBERs in the set_vrsave insn, and we do not
wish the argument registers to die. */
- for (i = cfun->args_info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i)
+ for (i = crtl->args.info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i)
mask &= ~ALTIVEC_REG_BIT (i);
/* Similarly, remove the return value from the set. */
info_ptr->reg_size = reg_size;
info_ptr->fixed_size = RS6000_SAVE_AREA;
info_ptr->vars_size = RS6000_ALIGN (get_frame_size (), 8);
- info_ptr->parm_size = RS6000_ALIGN (current_function_outgoing_args_size,
+ info_ptr->parm_size = RS6000_ALIGN (crtl->outgoing_args_size,
TARGET_ALTIVEC ? 16 : 8);
if (FRAME_GROWS_DOWNWARD)
info_ptr->vars_size
#define STARTING_FRAME_OFFSET \
(FRAME_GROWS_DOWNWARD \
? 0 \
- : (RS6000_ALIGN (current_function_outgoing_args_size, \
+ : (RS6000_ALIGN (crtl->outgoing_args_size, \
TARGET_ALTIVEC ? 16 : 8) \
+ RS6000_SAVE_AREA))
length of the outgoing arguments. The default is correct for most
machines. See `function.c' for details. */
#define STACK_DYNAMIC_OFFSET(FUNDECL) \
- (RS6000_ALIGN (current_function_outgoing_args_size, \
+ (RS6000_ALIGN (crtl->outgoing_args_size, \
TARGET_ALTIVEC ? 16 : 8) \
+ (STACK_POINTER_OFFSET))
/* Define this if the maximum size of all the outgoing args is to be
accumulated and pushed during the prologue. The amount can be
- found in the variable current_function_outgoing_args_size. */
+ found in the variable crtl->outgoing_args_size. */
#define ACCUMULATE_OUTGOING_ARGS 1
/* Value is the number of bytes of arguments automatically
{
/* Varargs functions need to save gprs 2 to 6. */
if (cfun->va_list_gpr_size
- && current_function_args_info.gprs < GP_ARG_NUM_REG)
+ && crtl->args.info.gprs < GP_ARG_NUM_REG)
{
- int min_gpr = current_function_args_info.gprs;
+ int min_gpr = crtl->args.info.gprs;
int max_gpr = min_gpr + cfun->va_list_gpr_size;
if (max_gpr > GP_ARG_NUM_REG)
max_gpr = GP_ARG_NUM_REG;
/* Mark f0, f2 for 31 bit and f0-f4 for 64 bit to be saved. */
if (TARGET_HARD_FLOAT && cfun->va_list_fpr_size
- && current_function_args_info.fprs < FP_ARG_NUM_REG)
+ && crtl->args.info.fprs < FP_ARG_NUM_REG)
{
- int min_fpr = current_function_args_info.fprs;
+ int min_fpr = crtl->args.info.fprs;
int max_fpr = min_fpr + cfun->va_list_fpr_size;
if (max_fpr > FP_ARG_NUM_REG)
max_fpr = FP_ARG_NUM_REG;
if (!TARGET_PACKED_STACK)
cfun_frame_layout.frame_size += (STACK_POINTER_OFFSET
- + current_function_outgoing_args_size
+ + crtl->outgoing_args_size
+ cfun_frame_layout.high_fprs * 8);
else
{
STACK_BOUNDARY / BITS_PER_UNIT - 1)
& ~(STACK_BOUNDARY / BITS_PER_UNIT - 1));
- cfun_frame_layout.frame_size += current_function_outgoing_args_size;
+ cfun_frame_layout.frame_size += crtl->outgoing_args_size;
}
}
case FRAME_POINTER_REGNUM:
offset = (get_frame_size()
+ STACK_POINTER_OFFSET
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
break;
case ARG_POINTER_REGNUM:
The following global variables are used to initialize
the va_list structure:
- current_function_args_info:
+ crtl->args.info:
holds number of gprs and fprs used for named arguments.
- current_function_arg_offset_rtx:
+ crtl->args.arg_offset_rtx:
holds the offset of the first anonymous stack argument
(relative to the virtual arg pointer). */
/* Count number of gp and fp argument registers used. */
- n_gpr = current_function_args_info.gprs;
- n_fpr = current_function_args_info.fprs;
+ n_gpr = crtl->args.info.gprs;
+ n_fpr = crtl->args.info.fprs;
if (cfun->va_list_gpr_size)
{
{
t = make_tree (TREE_TYPE (ovf), virtual_incoming_args_rtx);
- off = INTVAL (current_function_arg_offset_rtx);
+ off = INTVAL (crtl->args.arg_offset_rtx);
off = off < 0 ? 0 : off;
if (TARGET_DEBUG_ARG)
fprintf (stderr, "va_start: n_gpr = %d, n_fpr = %d off %d\n",
/* Offset from the stack pointer register to an item dynamically
allocated on the stack, e.g., by `alloca'. */
-extern int current_function_outgoing_args_size;
+extern int crtl->outgoing_args_size;
#define STACK_DYNAMIC_OFFSET(FUNDECL) \
- (STACK_POINTER_OFFSET + current_function_outgoing_args_size)
+ (STACK_POINTER_OFFSET + crtl->outgoing_args_size)
/* Offset of first parameter from the argument pointer register value.
We have a fake argument pointer register that points directly to
/* The offset of the first local variable from the beginning of the frame.
See compute_frame_size for details about the frame layout. */
-#define STARTING_FRAME_OFFSET current_function_outgoing_args_size
+#define STARTING_FRAME_OFFSET crtl->outgoing_args_size
/* The argument pointer always points to the first argument. */
#define FIRST_PARM_OFFSET(FUNDECL) 0
allocate the area reserved for arguments passed in registers.
If `ACCUMULATE_OUTGOING_ARGS' is also defined, the only effect
of this macro is to determine whether the space is included in
- `current_function_outgoing_args_size'. */
+ `crtl->outgoing_args_size'. */
#define OUTGOING_REG_PARM_STACK_SPACE 1
#define RETURN_POPS_ARGS(FUNDECL, FUNTYPE, STACK_SIZE) 0
f->gp_reg_size = 0;
f->mask = 0;
f->var_size = SCORE3_STACK_ALIGN (size);
- f->args_size = current_function_outgoing_args_size;
+ f->args_size = crtl->outgoing_args_size;
f->cprestore_size = flag_pic ? UNITS_PER_WORD : 0;
if (f->var_size == 0 && current_function_is_leaf)
f->gp_reg_size = 0;
f->mask = 0;
f->var_size = SCORE7_STACK_ALIGN (size);
- f->args_size = current_function_outgoing_args_size;
+ f->args_size = crtl->outgoing_args_size;
f->cprestore_size = flag_pic ? UNITS_PER_WORD : 0;
if (f->var_size == 0 && current_function_is_leaf)
f->args_size = f->cprestore_size = 0;
if (epilogue_p > 0)
{
int nreg = 0;
- if (current_function_return_rtx)
+ if (crtl->return_rtx)
{
enum machine_mode mode;
- mode = GET_MODE (current_function_return_rtx);
+ mode = GET_MODE (crtl->return_rtx);
if (BASE_RETURN_VALUE_REG (mode) == FIRST_RET_REG)
nreg = HARD_REGNO_NREGS (FIRST_RET_REG, mode);
}
/* Force PR to be live if the prologue has to call the SHmedia
argument decoder or register saver. */
if (TARGET_SHCOMPACT
- && ((current_function_args_info.call_cookie
+ && ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
|| current_function_saves_all_registers))
pr_live = 1;
: (/* Only push those regs which are used and need to be saved. */
(TARGET_SHCOMPACT
&& flag_pic
- && current_function_args_info.call_cookie
+ && crtl->args.info.call_cookie
&& reg == PIC_OFFSET_TABLE_REGNUM)
|| (df_regs_ever_live_p (reg)
&& (!call_really_used_regs[reg]
/* We have pretend args if we had an object sent partially in registers
and partially on the stack, e.g. a large structure. */
- pretend_args = current_function_pretend_args_size;
+ pretend_args = crtl->args.pretend_args_size;
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl)
&& (NPARM_REGS(SImode)
- > current_function_args_info.arg_count[(int) SH_ARG_INT]))
+ > crtl->args.info.arg_count[(int) SH_ARG_INT]))
pretend_args = 0;
output_stack_adjust (-pretend_args
- - current_function_args_info.stack_regs * 8,
+ - crtl->args.info.stack_regs * 8,
stack_pointer_rtx, 0, NULL);
- if (TARGET_SHCOMPACT && flag_pic && current_function_args_info.call_cookie)
+ if (TARGET_SHCOMPACT && flag_pic && crtl->args.info.call_cookie)
/* We're going to use the PIC register to load the address of the
incoming-argument decoder and/or of the return trampoline from
the GOT, so make sure the PIC register is preserved and
df_set_regs_ever_live (PIC_OFFSET_TABLE_REGNUM, true);
if (TARGET_SHCOMPACT
- && (current_function_args_info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1)))
+ && (crtl->args.info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1)))
{
int reg;
be pushed onto the stack live, so that register renaming
doesn't overwrite them. */
for (reg = 0; reg < NPARM_REGS (SImode); reg++)
- if (CALL_COOKIE_STACKSEQ_GET (current_function_args_info.call_cookie)
+ if (CALL_COOKIE_STACKSEQ_GET (crtl->args.info.call_cookie)
>= NPARM_REGS (SImode) - reg)
for (; reg < NPARM_REGS (SImode); reg++)
emit_insn (gen_shcompact_preserve_incoming_args
(gen_rtx_REG (SImode, FIRST_PARM_REG + reg)));
else if (CALL_COOKIE_INT_REG_GET
- (current_function_args_info.call_cookie, reg) == 1)
+ (crtl->args.info.call_cookie, reg) == 1)
emit_insn (gen_shcompact_preserve_incoming_args
(gen_rtx_REG (SImode, FIRST_PARM_REG + reg)));
emit_move_insn (gen_rtx_REG (Pmode, MACL_REG),
stack_pointer_rtx);
emit_move_insn (gen_rtx_REG (SImode, R0_REG),
- GEN_INT (current_function_args_info.call_cookie));
+ GEN_INT (crtl->args.info.call_cookie));
emit_move_insn (gen_rtx_REG (SImode, MACH_REG),
gen_rtx_REG (SImode, R0_REG));
}
rtx insn;
if (i >= (NPARM_REGS(SImode)
- - current_function_args_info.arg_count[(int) SH_ARG_INT]
+ - crtl->args.info.arg_count[(int) SH_ARG_INT]
))
break;
insn = push (rn);
frame_insn (GEN_MOV (hard_frame_pointer_rtx, stack_pointer_rtx));
if (TARGET_SHCOMPACT
- && (current_function_args_info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1)))
+ && (crtl->args.info.call_cookie & ~ CALL_COOKIE_RET_TRAMP(1)))
{
/* This must NOT go through the PLT, otherwise mach and macl
may be clobbered. */
emit_insn (gen_toggle_sz ());
target_flags = save_flags;
- output_stack_adjust (current_function_pretend_args_size
+ output_stack_adjust (crtl->args.pretend_args_size
+ save_size + d_rounding
- + current_function_args_info.stack_regs * 8,
+ + crtl->args.info.stack_regs * 8,
stack_pointer_rtx, e, NULL);
if (current_function_calls_eh_return)
sh_builtin_saveregs (void)
{
/* First unnamed integer register. */
- int first_intreg = current_function_args_info.arg_count[(int) SH_ARG_INT];
+ int first_intreg = crtl->args.info.arg_count[(int) SH_ARG_INT];
/* Number of integer registers we need to save. */
int n_intregs = MAX (0, NPARM_REGS (SImode) - first_intreg);
/* First unnamed SFmode float reg */
- int first_floatreg = current_function_args_info.arg_count[(int) SH_ARG_FLOAT];
+ int first_floatreg = crtl->args.info.arg_count[(int) SH_ARG_FLOAT];
/* Number of SFmode float regs to save. */
int n_floatregs = MAX (0, NPARM_REGS (SFmode) - first_floatreg);
rtx regbuf, fpregs;
while (pushregs < NPARM_REGS (SImode) - 1
&& (CALL_COOKIE_INT_REG_GET
- (current_function_args_info.call_cookie,
+ (crtl->args.info.call_cookie,
NPARM_REGS (SImode) - pushregs)
== 1))
{
- current_function_args_info.call_cookie
+ crtl->args.info.call_cookie
&= ~ CALL_COOKIE_INT_REG (NPARM_REGS (SImode)
- pushregs, 1);
pushregs++;
}
if (pushregs == NPARM_REGS (SImode))
- current_function_args_info.call_cookie
+ crtl->args.info.call_cookie
|= (CALL_COOKIE_INT_REG (0, 1)
| CALL_COOKIE_STACKSEQ (pushregs - 1));
else
- current_function_args_info.call_cookie
+ crtl->args.info.call_cookie
|= CALL_COOKIE_STACKSEQ (pushregs);
- current_function_pretend_args_size += 8 * n_intregs;
+ crtl->args.pretend_args_size += 8 * n_intregs;
}
if (TARGET_SHCOMPACT)
return const0_rtx;
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- nfp = current_function_args_info.arg_count[SH_ARG_FLOAT];
+ nfp = crtl->args.info.arg_count[SH_ARG_FLOAT];
if (nfp < 8)
nfp = 8 - nfp;
else
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- nint = current_function_args_info.arg_count[SH_ARG_INT];
+ nint = crtl->args.info.arg_count[SH_ARG_INT];
if (nint < 4)
nint = 4 - nint;
else
if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return total_saved_regs_space + total_auto_space
- + current_function_args_info.byref_regs * 8;
+ + crtl->args.info.byref_regs * 8;
if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
return total_saved_regs_space + total_auto_space
- + current_function_args_info.byref_regs * 8;
+ + crtl->args.info.byref_regs * 8;
/* Initial gap between fp and sp is 0. */
if (from == HARD_FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
if (current_function_is_leaf
&& ! sh_pr_n_sets ()
&& ! (TARGET_SHCOMPACT
- && ((current_function_args_info.call_cookie
+ && ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
|| current_function_saves_all_registers)))
x = hard_reg;
{
return (1
&& (! TARGET_SHCOMPACT
- || current_function_args_info.stack_regs == 0)
+ || crtl->args.info.stack_regs == 0)
&& ! sh_cfun_interrupt_handler_p ()
&& (! flag_pic
|| (decl && ! TREE_PUBLIC (decl))
PR register on SHcompact, because it might be clobbered by the prologue.
We check first if that is known to be the case. */
if (TARGET_SHCOMPACT
- && ((current_function_args_info.call_cookie
+ && ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
|| current_function_saves_all_registers))
return gen_frame_mem (SImode, return_address_pointer_rtx);
}
if (TARGET_SHCOMPACT
- && (current_function_args_info.call_cookie & CALL_COOKIE_RET_TRAMP (1)))
+ && (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1)))
{
emit_jump_insn (gen_shcompact_return_tramp ());
DONE;
(define_insn "*return_i"
[(return)]
"TARGET_SH1 && ! (TARGET_SHCOMPACT
- && (current_function_args_info.call_cookie
+ && (crtl->args.info.call_cookie
& CALL_COOKIE_RET_TRAMP (1)))
&& reload_completed
&& lookup_attribute (\"trap_exit\",
(define_expand "shcompact_return_tramp"
[(return)]
"TARGET_SHCOMPACT
- && (current_function_args_info.call_cookie & CALL_COOKIE_RET_TRAMP (1))"
+ && (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1))"
"
{
rtx reg = gen_rtx_REG (Pmode, R0_REG);
(define_insn "shcompact_return_tramp_i"
[(parallel [(return) (use (reg:SI R0_REG))])]
"TARGET_SHCOMPACT
- && (current_function_args_info.call_cookie & CALL_COOKIE_RET_TRAMP (1))"
+ && (crtl->args.info.call_cookie & CALL_COOKIE_RET_TRAMP (1))"
"jmp @r0%#"
[(set_attr "type" "jump_ind")
(set_attr "needs_delay_slot" "yes")])
HOST_WIDE_INT
sparc_compute_frame_size (HOST_WIDE_INT size, int leaf_function_p)
{
- int outgoing_args_size = (current_function_outgoing_args_size
+ int outgoing_args_size = (crtl->outgoing_args_size
+ REG_PARM_STACK_SPACE (current_function_decl));
int n_regs = 0; /* N_REGS is the number of 4-byte regs saved thus far. */
int i;
if (leaf_function_p
&& n_regs == 0
&& size == 0
- && current_function_outgoing_args_size == 0)
+ && crtl->outgoing_args_size == 0)
actual_fsize = apparent_fsize = 0;
else
{
static rtx
sparc_builtin_saveregs (void)
{
- int first_reg = current_function_args_info.words;
+ int first_reg = crtl->args.info.words;
rtx address;
int regno;
#define EXIT_IGNORE_STACK \
(get_frame_size () != 0 \
- || current_function_calls_alloca || current_function_outgoing_args_size)
+ || current_function_calls_alloca || crtl->outgoing_args_size)
/* Define registers used by the epilogue and return instruction. */
#define EPILOGUE_USES(REGNO) ((REGNO) == 31 \
if (cfun->static_chain_decl == 0
&& (spu_saved_regs_size ()
+ get_frame_size ()
- + current_function_outgoing_args_size
- + current_function_pretend_args_size == 0)
+ + crtl->outgoing_args_size
+ + crtl->args.pretend_args_size == 0)
&& current_function_is_leaf)
return 1;
}
prev SP | back chain |
+-------------+
| var args |
- | reg save | current_function_pretend_args_size bytes
+ | reg save | crtl->args.pretend_args_size bytes
+-------------+
| ... |
| saved regs | spu_saved_regs_size() bytes
+-------------+
| ... |
| outgoing |
- | args | current_function_outgoing_args_size bytes
+ | args | crtl->outgoing_args_size bytes
+-------------+
| $lr of next |
| frame |
saved_regs_size = spu_saved_regs_size ();
total_size = size + saved_regs_size
- + current_function_outgoing_args_size
- + current_function_pretend_args_size;
+ + crtl->outgoing_args_size
+ + crtl->args.pretend_args_size;
if (!current_function_is_leaf
|| current_function_calls_alloca || total_size > 0)
if (total_size > 0)
{
- offset = -current_function_pretend_args_size;
+ offset = -crtl->args.pretend_args_size;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (need_to_save_reg (regno, 1))
{
{
rtx fp_reg = gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM);
HOST_WIDE_INT fp_offset = STACK_POINTER_OFFSET
- + current_function_outgoing_args_size;
+ + crtl->outgoing_args_size;
/* Set the new frame_pointer */
insn = frame_emit_add_imm (fp_reg, sp_reg, fp_offset, scratch_reg_0);
RTX_FRAME_RELATED_P (insn) = 1;
saved_regs_size = spu_saved_regs_size ();
total_size = size + saved_regs_size
- + current_function_outgoing_args_size
- + current_function_pretend_args_size;
+ + crtl->outgoing_args_size
+ + crtl->args.pretend_args_size;
if (!current_function_is_leaf
|| current_function_calls_alloca || total_size > 0)
if (saved_regs_size > 0)
{
- offset = -current_function_pretend_args_size;
+ offset = -crtl->args.pretend_args_size;
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; ++regno)
if (need_to_save_reg (regno, 1))
{
{
int saved_regs_size = spu_saved_regs_size ();
int sp_offset = 0;
- if (!current_function_is_leaf || current_function_outgoing_args_size
+ if (!current_function_is_leaf || crtl->outgoing_args_size
|| get_frame_size () || saved_regs_size)
sp_offset = STACK_POINTER_OFFSET;
if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
- return (sp_offset + current_function_outgoing_args_size);
+ return (sp_offset + crtl->outgoing_args_size);
else if (from == FRAME_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return 0;
else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
- return sp_offset + current_function_outgoing_args_size
+ return sp_offset + crtl->outgoing_args_size
+ get_frame_size () + saved_regs_size + STACK_POINTER_OFFSET;
else if (from == ARG_POINTER_REGNUM && to == HARD_FRAME_POINTER_REGNUM)
return get_frame_size () + saved_regs_size + sp_offset;
The following global variables are used to initialize
the va_list structure:
- current_function_args_info;
+ crtl->args.info;
the CUMULATIVE_ARGS for this function
- current_function_arg_offset_rtx:
+ crtl->args.arg_offset_rtx:
holds the offset of the first anonymous stack argument
(relative to the virtual arg pointer). */
/* Find the __args area. */
t = make_tree (TREE_TYPE (args), nextarg);
- if (current_function_pretend_args_size > 0)
+ if (crtl->args.pretend_args_size > 0)
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (args), t,
size_int (-STACK_POINTER_OFFSET));
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (args), args, t);
/* Find the __skip area. */
t = make_tree (TREE_TYPE (skip), virtual_incoming_args_rtx);
t = build2 (POINTER_PLUS_EXPR, TREE_TYPE (skip), t,
- size_int (current_function_pretend_args_size
+ size_int (crtl->args.pretend_args_size
- STACK_POINTER_OFFSET));
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (skip), skip, t);
TREE_SIDE_EFFECTS (t) = 1;
+ layout.register_save_size
+ layout.stdarg_save_size);
- if (current_function_args_size <= 2048 && current_function_args_size != -1)
+ if (crtl->args.size <= 2048 && crtl->args.size != -1)
{
if (layout.frame_size + INCOMING_FRAME_SP_OFFSET
- + current_function_args_size <= 2048)
+ + crtl->args.size <= 2048)
layout.fp_minus_ap = layout.frame_size + INCOMING_FRAME_SP_OFFSET;
else
- layout.fp_minus_ap = 2048 - current_function_args_size;
+ layout.fp_minus_ap = 2048 - crtl->args.size;
}
else
layout.fp_minus_ap = (layout.stdarg_save_size
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (count), count,
build_int_cst (NULL_TREE,
- current_function_args_info * UNITS_PER_WORD));
+ crtl->args.info * UNITS_PER_WORD));
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
{
return (size
+ compute_register_save_size (p_reg_saved)
- + current_function_outgoing_args_size);
+ + crtl->outgoing_args_size);
}
\f
}
/* Save arg registers to the stack if necessary. */
- else if (current_function_args_info.anonymous_args)
+ else if (crtl->args.info.anonymous_args)
{
if (TARGET_PROLOG_FUNCTION && TARGET_V850E && !TARGET_DISABLE_CALLT)
emit_insn (gen_save_r6_r9_v850e ());
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
{ \
if ((FROM) == FRAME_POINTER_REGNUM) \
- (OFFSET) = get_frame_size () + current_function_outgoing_args_size; \
+ (OFFSET) = get_frame_size () + crtl->outgoing_args_size; \
else if ((FROM) == ARG_POINTER_REGNUM) \
(OFFSET) = compute_frame_size (get_frame_size (), (long *)0); \
else \
xtensa_current_frame_size =
XTENSA_STACK_ALIGN (size
- + current_function_outgoing_args_size
+ + crtl->outgoing_args_size
+ (WINDOW_SIZE * UNITS_PER_WORD));
return xtensa_current_frame_size;
}
xtensa_builtin_saveregs (void)
{
rtx gp_regs;
- int arg_words = current_function_args_info.arg_words;
+ int arg_words = crtl->args.info.arg_words;
int gp_left = MAX_ARGS_IN_REGISTERS - arg_words;
if (gp_left <= 0)
tree t, u;
int arg_words;
- arg_words = current_function_args_info.arg_words;
+ arg_words = crtl->args.info.arg_words;
f_stk = TYPE_FIELDS (va_list_type_node);
f_reg = TREE_CHAIN (f_stk);
/* Use the AR registers in increasing order (skipping a0 and a1)
but save the incoming argument registers for a last resort. */
- num_arg_regs = current_function_args_info.arg_words;
+ num_arg_regs = crtl->args.info.arg_words;
if (num_arg_regs > MAX_ARGS_IN_REGISTERS)
num_arg_regs = MAX_ARGS_IN_REGISTERS;
for (i = GP_ARG_FIRST; i < 16 - num_arg_regs; i++)
/* Offset within stack frame to start allocating local variables at. */
#define STARTING_FRAME_OFFSET \
- current_function_outgoing_args_size
+ crtl->outgoing_args_size
/* The ARG_POINTER and FRAME_POINTER are not real Xtensa registers, so
they are eliminated to either the stack pointer or hard frame pointer. */
/* If defined, the maximum amount of space required for outgoing
arguments will be computed and placed into the variable
- 'current_function_outgoing_args_size'. No space will be pushed
+ 'crtl->outgoing_args_size'. No space will be pushed
onto the stack for each call; instead, the function prologue
should increase the stack frame size by this amount. */
#define ACCUMULATE_OUTGOING_ARGS 1
if (flag_reorder_blocks_and_partition)
{
dbxout_begin_empty_stabs (N_FUN);
- dbxout_stab_value_label_diff (cfun->hot_section_end_label,
- cfun->hot_section_label);
+ dbxout_stab_value_label_diff (crtl->subsections.hot_section_end_label,
+ crtl->subsections.hot_section_label);
dbxout_begin_empty_stabs (N_FUN);
- dbxout_stab_value_label_diff (cfun->cold_section_end_label,
- cfun->cold_section_label);
+ dbxout_stab_value_label_diff (crtl->subsections.cold_section_end_label,
+ crtl->subsections.cold_section_label);
}
else
{
&& (!is_sibling_call
|| !bitmap_bit_p (df->exit_block_uses, ui)
|| refers_to_regno_p (ui, ui+1,
- current_function_return_rtx, NULL)))
+ crtl->return_rtx, NULL)))
df_ref_record (collection_rec, regno_reg_rtx[ui],
NULL, bb, insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER | flags, -1, -1);
}
fde = &fde_table[fde_table_in_use - 1];
fde->dw_fde_switched_sections = true;
- fde->dw_fde_hot_section_label = cfun->hot_section_label;
- fde->dw_fde_hot_section_end_label = cfun->hot_section_end_label;
- fde->dw_fde_unlikely_section_label = cfun->cold_section_label;
- fde->dw_fde_unlikely_section_end_label = cfun->cold_section_end_label;
+ fde->dw_fde_hot_section_label = crtl->subsections.hot_section_label;
+ fde->dw_fde_hot_section_end_label = crtl->subsections.hot_section_end_label;
+ fde->dw_fde_unlikely_section_label = crtl->subsections.cold_section_label;
+ fde->dw_fde_unlikely_section_end_label = crtl->subsections.cold_section_end_label;
have_multiple_function_sections = true;
/* Reset the current label on switching text sections, so that we
current_line = 1;
if (cfun && in_cold_section_p)
- strcpy (prev_line_label, cfun->cold_section_label);
+ strcpy (prev_line_label, crtl->subsections.cold_section_label);
else
strcpy (prev_line_label, text_section_label);
for (lt_index = 1; lt_index < line_info_table_in_use; ++lt_index)
secname = TREE_STRING_POINTER (sectree);
}
else if (cfun && in_cold_section_p)
- secname = cfun->cold_section_label;
+ secname = crtl->subsections.cold_section_label;
else
secname = text_section_label;
newloc->next = NULL;
if (cfun && in_cold_section_p)
- newloc->section_label = cfun->cold_section_label;
+ newloc->section_label = crtl->subsections.cold_section_label;
else
newloc->section_label = text_section_label;
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;
}
\f
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
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);
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);
}
/* 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);
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;
}
}
}
void
diddle_return_value (void (*doit) (rtx, void *), void *arg)
{
- rtx outgoing = current_function_return_rtx;
+ rtx outgoing = crtl->return_rtx;
if (! outgoing)
return;
? 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));
/* 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));
/* 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. */
unsigned int deferred_constants;
};
+/* Information mainlined about RTL representation of incoming arguments. */
+struct incoming_args GTY(())
+{
+ /* Number of bytes of args popped by function being compiled on its return.
+ Zero if no bytes are to be popped.
+ May affect compilation of return insn or of function epilogue. */
+ int pops_args;
+
+ /* If function's args have a fixed size, this is that size, in bytes.
+ Otherwise, it is -1.
+ May affect compilation of return insn or of function epilogue. */
+ int size;
+
+ /* # bytes the prologue should push and pretend that the caller pushed them.
+ The prologue must do this, but only if parms can be passed in
+ registers. */
+ int pretend_args_size;
+
+ /* This is the offset from the arg pointer to the place where the first
+ anonymous arg can be found, if there is one. */
+ rtx arg_offset_rtx;
+
+ /* Quantities of various kinds of registers
+ used for the current function's args. */
+ CUMULATIVE_ARGS info;
+
+ /* The arg pointer hard register, or the pseudo into which it was copied. */
+ rtx internal_arg_pointer;
+};
+
+/* Data for function partitioning. */
+struct function_subsections GTY(())
+{
+ /* Assembly labels for the hot and cold text sections, to
+ be used by debugger functions for determining the size of text
+ sections. */
+
+ const char *hot_section_label;
+ const char *cold_section_label;
+ const char *hot_section_end_label;
+ const char *cold_section_end_label;
+
+ /* String to be used for name of cold text sections, via
+ targetm.asm_out.named_section. */
+
+ const char *unlikely_text_section_name;
+};
+
/* Datastructures maintained for currently processed function in RTL form. */
struct rtl_data GTY(())
{
struct expr_status expr;
struct emit_status emit;
struct varasm_status varasm;
+ struct incoming_args args;
+ struct function_subsections subsections;
+
+ /* For function.c */
+
+ /* # of bytes of outgoing arguments. If ACCUMULATE_OUTGOING_ARGS is
+ defined, the needed space is pushed by the prologue. */
+ int outgoing_args_size;
+
+ /* If nonzero, an RTL expression for the location at which the current
+ function returns its result. If the current function returns its
+ result in a register, current_function_return_rtx will always be
+ the hard register containing the result. */
+ rtx return_rtx;
+
+ /* Opaque pointer used by get_hard_reg_initial_val and
+ has_hard_reg_initial_val (see integrate.[hc]). */
+ struct initial_value_struct *hard_reg_initial_vals;
/* List (chain of EXPR_LIST) of labels heading the current handlers for
nonlocal gotos. */
/* Current nesting level for temporaries. */
int x_temp_slot_level;
- /* Highest label number in current function. */
- int inl_max_label_num;
};
#define return_label (crtl->x_return_label)
/* Function containing this function, if any. */
struct function *outer;
- /* Number of bytes of args popped by function being compiled on its return.
- Zero if no bytes are to be popped.
- May affect compilation of return insn or of function epilogue. */
- int pops_args;
-
- /* If function's args have a fixed size, this is that size, in bytes.
- Otherwise, it is -1.
- May affect compilation of return insn or of function epilogue. */
- int args_size;
-
- /* # bytes the prologue should push and pretend that the caller pushed them.
- The prologue must do this, but only if parms can be passed in
- registers. */
- int pretend_args_size;
-
- /* # of bytes of outgoing arguments. If ACCUMULATE_OUTGOING_ARGS is
- defined, the needed space is pushed by the prologue. */
- int outgoing_args_size;
-
- /* This is the offset from the arg pointer to the place where the first
- anonymous arg can be found, if there is one. */
- rtx arg_offset_rtx;
-
- /* Quantities of various kinds of registers
- used for the current function's args. */
- CUMULATIVE_ARGS args_info;
-
- /* If nonzero, an RTL expression for the location at which the current
- function returns its result. If the current function returns its
- result in a register, current_function_return_rtx will always be
- the hard register containing the result. */
- rtx return_rtx;
-
- /* The arg pointer hard register, or the pseudo into which it was copied. */
- rtx internal_arg_pointer;
-
- /* Opaque pointer used by get_hard_reg_initial_val and
- has_hard_reg_initial_val (see integrate.[hc]). */
- struct initial_value_struct *hard_reg_initial_vals;
-
/* A PARM_DECL that should contain the static chain for this function.
It will be initialized at the beginning of the function. */
tree static_chain_decl;
/* The variables unexpanded so far. */
tree unexpanded_var_list;
- /* Assembly labels for the hot and cold text sections, to
- be used by debugger functions for determining the size of text
- sections. */
-
- const char *hot_section_label;
- const char *cold_section_label;
- const char *hot_section_end_label;
- const char *cold_section_end_label;
-
- /* String to be used for name of cold text sections, via
- targetm.asm_out.named_section. */
-
- const char *unlikely_text_section_name;
-
/* A variable living at the top of the frame that holds a known value.
Used for detecting stack clobbers. */
tree stack_protect_guard;
extern void instantiate_decl_rtl (rtx x);
/* For backward compatibility... eventually these should all go away. */
-#define current_function_pops_args (cfun->pops_args)
#define current_function_returns_struct (cfun->returns_struct)
#define current_function_returns_pcc_struct (cfun->returns_pcc_struct)
#define current_function_calls_setjmp (cfun->calls_setjmp)
#define current_function_accesses_prior_frames (cfun->accesses_prior_frames)
#define current_function_calls_eh_return (cfun->calls_eh_return)
#define current_function_is_thunk (cfun->is_thunk)
-#define current_function_args_info (cfun->args_info)
-#define current_function_args_size (cfun->args_size)
-#define current_function_pretend_args_size (cfun->pretend_args_size)
-#define current_function_outgoing_args_size (cfun->outgoing_args_size)
-#define current_function_arg_offset_rtx (cfun->arg_offset_rtx)
#define current_function_stdarg (cfun->stdarg)
-#define current_function_internal_arg_pointer (cfun->internal_arg_pointer)
-#define current_function_return_rtx (cfun->return_rtx)
#define current_function_profile (cfun->profile)
#define current_function_funcdef_no (cfun->funcdef_no)
#define current_function_limit_stack (cfun->limit_stack)
the function. */
rtx
-get_hard_reg_initial_reg (struct function *fun, rtx reg)
+get_hard_reg_initial_reg (rtx reg)
{
- struct initial_value_struct *ivs = fun->hard_reg_initial_vals;
+ struct initial_value_struct *ivs = crtl->hard_reg_initial_vals;
int i;
if (ivs == 0)
if (rv)
return rv;
- ivs = cfun->hard_reg_initial_vals;
+ ivs = crtl->hard_reg_initial_vals;
if (ivs == 0)
{
ivs = ggc_alloc (sizeof (initial_value_struct));
ivs->num_entries = 0;
ivs->max_entries = 5;
ivs->entries = ggc_alloc (5 * sizeof (initial_value_pair));
- cfun->hard_reg_initial_vals = ivs;
+ crtl->hard_reg_initial_vals = ivs;
}
if (ivs->num_entries >= ivs->max_entries)
struct initial_value_struct *ivs;
int i;
- ivs = cfun->hard_reg_initial_vals;
+ ivs = crtl->hard_reg_initial_vals;
if (ivs != 0)
for (i = 0; i < ivs->num_entries; i++)
if (GET_MODE (ivs->entries[i].hard_reg) == mode
unsigned int
emit_initial_value_sets (void)
{
- struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;
+ struct initial_value_struct *ivs = crtl->hard_reg_initial_vals;
int i;
rtx seq;
{
if (targetm.allocate_initial_value)
{
- struct initial_value_struct *ivs = cfun->hard_reg_initial_vals;
+ struct initial_value_struct *ivs = crtl->hard_reg_initial_vals;
int i;
if (ivs == 0)
extern rtx has_hard_reg_initial_val (enum machine_mode, unsigned int);
/* If a pseudo represents an initial hard reg (or expression), return
it, else return NULL_RTX. */
-extern rtx get_hard_reg_initial_reg (struct function *, rtx);
+extern rtx get_hard_reg_initial_reg (rtx);
/* Called from rest_of_compilation. */
extern unsigned int emit_initial_value_sets (void);
extern void allocate_initial_values (rtx *);
/* Avoid making a call-saved register unnecessarily
clobbered. */
- hard_reg = get_hard_reg_initial_reg (cfun, r1);
+ hard_reg = get_hard_reg_initial_reg (r1);
if (hard_reg != NULL_RTX)
{
if (REG_P (hard_reg)
else
SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM);
- if (current_function_return_rtx != 0)
- mark_referenced_resources (current_function_return_rtx,
+ if (crtl->return_rtx != 0)
+ mark_referenced_resources (crtl->return_rtx,
&end_of_function_needs, 1);
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
tree dsn;
gcc_assert (cfun && current_function_decl);
- if (cfun->unlikely_text_section_name)
+ if (crtl->subsections.unlikely_text_section_name)
return;
dsn = DECL_SECTION_NAME (current_function_decl);
stripped_name = targetm.strip_name_encoding (name);
buffer = ACONCAT ((stripped_name, "_unlikely", NULL));
- cfun->unlikely_text_section_name = ggc_strdup (buffer);
+ crtl->subsections.unlikely_text_section_name = ggc_strdup (buffer);
}
else
- cfun->unlikely_text_section_name = UNLIKELY_EXECUTED_TEXT_SECTION_NAME;
+ crtl->subsections.unlikely_text_section_name = UNLIKELY_EXECUTED_TEXT_SECTION_NAME;
}
/* Tell assembler to switch to unlikely-to-be-executed text section. */
{
if (cfun)
{
- if (!cfun->unlikely_text_section_name)
+ if (!crtl->subsections.unlikely_text_section_name)
initialize_cold_section_name ();
- return get_named_section (NULL, cfun->unlikely_text_section_name, 0);
+ return get_named_section (NULL, crtl->subsections.unlikely_text_section_name, 0);
}
else
return get_named_section (NULL, UNLIKELY_EXECUTED_TEXT_SECTION_NAME, 0);
const char *name;
if (cfun)
- name = cfun->unlikely_text_section_name;
+ name = crtl->subsections.unlikely_text_section_name;
else
name = UNLIKELY_EXECUTED_TEXT_SECTION_NAME;
char tmp_label[100];
bool hot_label_written = false;
- cfun->unlikely_text_section_name = NULL;
+ crtl->subsections.unlikely_text_section_name = NULL;
first_function_block_is_cold = false;
if (flag_reorder_blocks_and_partition)
{
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTB", const_labelno);
- cfun->hot_section_label = ggc_strdup (tmp_label);
+ crtl->subsections.hot_section_label = ggc_strdup (tmp_label);
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDB", const_labelno);
- cfun->cold_section_label = ggc_strdup (tmp_label);
+ crtl->subsections.cold_section_label = ggc_strdup (tmp_label);
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LHOTE", const_labelno);
- cfun->hot_section_end_label = ggc_strdup (tmp_label);
+ crtl->subsections.hot_section_end_label = ggc_strdup (tmp_label);
ASM_GENERATE_INTERNAL_LABEL (tmp_label, "LCOLDE", const_labelno);
- cfun->cold_section_end_label = ggc_strdup (tmp_label);
+ crtl->subsections.cold_section_end_label = ggc_strdup (tmp_label);
const_labelno++;
}
else
{
- cfun->hot_section_label = NULL;
- cfun->cold_section_label = NULL;
- cfun->hot_section_end_label = NULL;
- cfun->cold_section_end_label = NULL;
+ crtl->subsections.hot_section_label = NULL;
+ crtl->subsections.cold_section_label = NULL;
+ crtl->subsections.hot_section_end_label = NULL;
+ crtl->subsections.cold_section_end_label = NULL;
}
/* The following code does not need preprocessing in the assembler. */
{
switch_to_section (unlikely_text_section ());
assemble_align (DECL_ALIGN (decl));
- ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_label);
+ ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.cold_section_label);
/* When the function starts with a cold section, we need to explicitly
align the hot section and write out the hot section label.
{
switch_to_section (text_section);
assemble_align (DECL_ALIGN (decl));
- ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
+ ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label);
hot_label_written = true;
first_function_block_is_cold = true;
}
initialize_cold_section_name ();
- if (cfun->unlikely_text_section_name
+ if (crtl->subsections.unlikely_text_section_name
&& strcmp (TREE_STRING_POINTER (DECL_SECTION_NAME (decl)),
- cfun->unlikely_text_section_name) == 0)
+ crtl->subsections.unlikely_text_section_name) == 0)
first_function_block_is_cold = true;
}
switch_to_section (function_section (decl));
if (flag_reorder_blocks_and_partition
&& !hot_label_written)
- ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_label);
+ ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_label);
/* Tell assembler to move to target machine's alignment for functions. */
align = floor_log2 (DECL_ALIGN (decl) / BITS_PER_UNIT);
save_text_section = in_section;
switch_to_section (unlikely_text_section ());
- ASM_OUTPUT_LABEL (asm_out_file, cfun->cold_section_end_label);
+ ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.cold_section_end_label);
if (first_function_block_is_cold)
switch_to_section (text_section);
else
switch_to_section (function_section (decl));
- ASM_OUTPUT_LABEL (asm_out_file, cfun->hot_section_end_label);
+ ASM_OUTPUT_LABEL (asm_out_file, crtl->subsections.hot_section_end_label);
switch_to_section (save_text_section);
}
}
flags = 0;
else if (current_function_decl
&& cfun
- && cfun->unlikely_text_section_name
- && strcmp (name, cfun->unlikely_text_section_name) == 0)
+ && crtl->subsections.unlikely_text_section_name
+ && strcmp (name, crtl->subsections.unlikely_text_section_name) == 0)
flags = SECTION_CODE;
else if (!decl
&& (!current_function_decl || !cfun)
{
case SECTION_NAMED:
if (cfun
- && !cfun->unlikely_text_section_name
+ && !crtl->subsections.unlikely_text_section_name
&& strcmp (new_section->named.name,
UNLIKELY_EXECUTED_TEXT_SECTION_NAME) == 0)
- cfun->unlikely_text_section_name = UNLIKELY_EXECUTED_TEXT_SECTION_NAME;
+ crtl->subsections.unlikely_text_section_name = UNLIKELY_EXECUTED_TEXT_SECTION_NAME;
targetm.asm_out.named_section (new_section->named.name,
new_section->named.common.flags,