+2008-04-25 Jan Hubicka <jh@suse.cz>
+
+ PR testsuite/35843
+ * cfgexpand.c (pass_expand): Turn into RTL pass.
+ * passes.c (execute_one_pass): Do pass typechecking after execution.
+ * tree-pass.h (pass_expand): Turn into RTL pass.
+
+ * function.h (struct rtl_data): Move here fields
+ accesses_prior_frames, calls_eh_return, saves_all_registers,
+ has_nonlocal_goto, has_asm_statement, is_thunk,
+ all_throwers_are_sibcalls, limit_stack, profile, uses_const_pool,
+ uses_pic_offset_table, uses_eh_lsda, tail_call_emit,
+ arg_pointer_save_area_init from struct function; turn into bool.
+ (struct function): Move
+ calls_eh_return, saves_all_registers, has_nonlocal_goto,
+ has_asm_statement, is_thunk, all_throwers_are_sibcalls, limit_stack,
+ profile, uses_const_pool, uses_pic_offset_table, uses_eh_lsda,
+ tail_call_emit, arg_pointer_save_area_init
+ into struct rtl_data. Remove recursive_call_emit and gimplified flags.
+ (current_function_returns_struct, current_function_returns_pcc_struct,
+ current_function_calls_setjmp, current_function_calls_alloca,
+ current_function_accesses_prior_frames,
+ current_function_calls_eh_return, current_function_is_thunk,
+ current_function_stdarg, current_function_profile,
+ current_function_limit_stack, current_function_uses_pic_offset_table,
+ current_function_uses_const_pool, current_function_has_nonlocal_label,
+ current_function_saves_all_registers,
+ current_function_has_nonlocal_goto,
+ current_function_has_asm_statement): Remove accesor macros.
+ * ra-conflict.c (global_conflicts): Update.
+ * tree-tailcall.c (suitable_for_tail_opt_p): Update.
+ (suitable_for_tail_call_opt_p): Update.
+ * builtins.c (expand_builtin_return_addr): Update.
+ (expand_builtin_setjmp_setup): Update.
+ (expand_builtin_nonlocal_goto): Update.
+ * final.c (final_start_function): Update.
+ (profile_function): Update.
+ (leaf_function_p): Update.
+ (only_leaf_regs_used): Update.
+ * df-scan.c (df_get_exit_block_use_set): Update.
+ * dojump.c (clear_pending_stack_adjust): Update.
+ * tree-stdarg.c (gate_optimize_stdarg): Update.
+ * gimple-low.c (lower_function_body): Update.
+ * global.c (compute_regsets): Update.
+ (global_alloc): Update.
+ * dwarf2out.c (dwarf2out_begin_prologue): Update.
+ * expr.c (expand_assignment): Update.
+ * dse.c (dse_step0): Update.
+ (dse_step1): Update.
+ * c-decl.c (store_parm_decls): Update.
+ * local-alloc.c (combine_regs): Update.
+ (find_free_reg): Update.
+ * function.c (assign_parms_augmented_arg_list): Update.
+ (assign_parm_find_data_types): Update.
+ (assign_parms): Update.
+ (allocate_struct_function): Update.
+ (expand_function_start): Update.
+ (expand_function_end): Update.
+ (get_arg_pointer_save_area): Update.
+ (thread_prologue_and_epilogue_insns): Update.
+ (rest_of_match_asm_constraints): Update.
+ * stor-layout.c (variable_size): Update.
+ * gcse.c (gcse_main): Update.
+ (bypass_jumps): Update.
+ * gimplify.c (gimplify_function_tree): Update.
+ * calls.c (emit_call_1): Update.
+ (expand_call): Update.
+ * bt-load.c (compute_defs_uses_and_gen): Update.
+ * except.c (sjlj_assign_call_site_values): Update.
+ (sjlj_emit_function_enter): Update.
+ (can_throw_external): Update.
+ (set_nothrow_function_flags): Update.
+ (expand_builtin_unwind_init): Update.
+ (expand_eh_return): Update.
+ (convert_to_eh_region_ranges): Update.
+ (output_function_exception_table): Update.
+ * emit-rtl.c (gen_tmp_stack_mem): Update.
+ * cfgexpand.c (expand_used_vars): Update.
+ (tree_expand_cfg): Update.
+ * cfgcleanup.c (rest_of_handle_jump): Update.
+ * explow.c (allocate_dynamic_stack_space): Update.
+ * varasm.c (assemble_start_function): Update.
+ (force_const_mem): Update.
+ (mark_constant_pool): Update.
+ * tree-optimize.c (tree_rest_of_compilation): Update.
+ * stack-ptr-mod.c (notice_stack_pointer_modification): Update.
+ * tree-cfg.c (notice_special_calls): Update.
+ (is_ctrl_altering_stmt): Update.
+ (tree_can_make_abnormal_goto): Update.
+ (tree_purge_dead_abnormal_call_edges): Update.
+ * config/alpha/predicates.md: Update.
+ * config/alpha/alpha.c (alpha_sa_mask): Update.
+ (alpha_sa_size): Update.
+ (alpha_does_function_need_gp): Update.
+ (alpha_expand_prologue): Update.
+ (alpha_start_function): Update.
+ (alpha_output_function_end_prologue): Update.
+ (alpha_expand_epilogue): Update.
+ * config/frv/frv.c (frv_stack_info): Update.
+ (frv_expand_epilogue): Update.
+ * config/s390/s390.c (s390_regs_ever_clobbered): Update.
+ (s390_register_info): Update.
+ (s390_frame_info): Update.
+ (s390_init_frame_layout): Update.
+ (s390_can_eliminate): Update.
+ (save_gprs): Update.
+ * config/spu/spu.c (spu_split_immediate): Update.
+ (need_to_save_reg): Update.
+ (spu_expand_prologue): Update.
+ (spu_expand_epilogue): Update.
+ * config/sparc/sparc.md: Update.
+ * config/sparc/sparc.c (eligible_for_return_delay): Update.
+ (sparc_tls_got): Update.
+ (legitimize_pic_address): Update.
+ (sparc_emit_call_insn): Update.
+ (sparc_expand_prologue): Update.
+ (output_return): Update.
+ (print_operand): Update.
+ (sparc_function_ok_for_sibcall): Update.
+ * config/sparc/sparc.h (EXIT_IGNORE_STACK): Update.
+ * config/m32r/m32r.md: Update.
+ * config/m32r/m32r.c (MUST_SAVE_RETURN_ADDR): Update.
+ (m32r_compute_frame_size): Update.
+ (m32r_expand_prologue): Update.
+ (m32r_expand_epilogue): Update.
+ (m32r_legitimize_pic_address): Update.
+ * config/m32r/m32r.h (FRAME_POINTER_REQUIRED): Update.
+ * config/i386/linux.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
+ * config/i386/i386.c (ix86_frame_pointer_required): Update.
+ (gen_push): Update.
+ (ix86_save_reg): Update.
+ (ix86_compute_frame_layout): Update.
+ (ix86_expand_prologue): Update.
+ (ix86_expand_epilogue): Update.
+ * config/sh/sh.c (output_stack_adjust): Update.
+ (calc_live_regs): Update.
+ (sh5_schedule_saves): Update.
+ (sh_expand_prologue): Update.
+ (sh_expand_epilogue): Update.
+ (sh_setup_incoming_varargs): Update.
+ (sh_allocate_initial_value): Update.
+ (sh_get_pr_initial_val): Update.
+ * config/sh/sh.h (SHMEDIA_REGS_STACK_ADJUST): Update.
+ * config/sh/sh.md (label:): Update.
+ * config/avr/avr.c (out_movhi_mr_r): Update.
+ * config/crx/crx.h (enum): Update.
+ * config/xtensa/xtensa.h (along): Update.
+ * config/stormy16/stormy16.c Update.
+ (xstormy16_compute_stack_layout): Update.
+ * config/fr30/fr30.c (MUST_SAVE_RETURN_POINTER): Update.
+ (fr30_expand_prologue): Update.
+ * config/cris/cris.c (cris_conditional_register_usage): Update.
+ (cris_reg_saved_in_regsave_area): Update.
+ (cris_initial_frame_pointer_offset): Update.
+ (cris_simple_epilogue): Update.
+ (cris_expand_prologue): Update.
+ (cris_expand_epilogue): Update.
+ (cris_expand_pic_call_address): Update.
+ (cris_asm_output_symbol_ref): Update.
+ (cris_asm_output_label_ref): Update.
+ * config/cris/cris.md Update.
+ * config/iq2000/iq2000.c (compute_frame_size): Update.
+ (iq2000_expand_epilogue): Update.
+ * config/mt/mt.h (save_direction): Update.
+ * config/mn10300/mn10300.c (mn10300_function_value): Update.
+ * config/ia64/ia64.c (ia64_compute_frame_size): Update.
+ (ia64_secondary_reload_class): Update.
+ * config/m68k/m68k.c (m68k_save_reg): Update.
+ (m68k_expand_prologue): Update.
+ (m68k_expand_epilogue): Update.
+ (legitimize_pic_address): Update.
+ * config/rs6000/rs6000.c (rs6000_got_register): Update.
+ (first_reg_to_save): Update.
+ (first_altivec_reg_to_save): Update.
+ (compute_vrsave_mask): Update.
+ (compute_save_world_info): Update.
+ (rs6000_stack_info): Update.
+ (spe_func_has_64bit_regs_p): Update.
+ (rs6000_ra_ever_killed): Update.
+ (rs6000_emit_eh_reg_restore): Update.
+ (rs6000_emit_allocate_stack): Update.
+ (rs6000_emit_prologue): Update.
+ (rs6000_emit_epilogue): Update.
+ (rs6000_output_function_epilogue): Update.
+ (output_profile_hook): Update.
+ (rs6000_elf_declare_function_name): Update.
+ * config/rs6000/rs6000.h (rs6000_args): Update.
+ * config/rs6000/rs6000.md: Update.
+ * config/mcore/mcore.c (mcore_expand_prolog): Update.
+ * config/arc/arc.c (arc_output_function_epilogue): Update.
+ * config/arc/arc.h (FRAME_POINTER_REQUIRED): Update.
+ * config/darwin.c (machopic_function_base_name): Update.
+ * config/score/score3.c (score3_compute_frame_size): Update.
+ (rpush): Update.
+ (rpop): Update.
+ (score3_epilogue): Update.
+ * config/score/score7.c (score7_compute_frame_size): Update.
+ (score7_prologue): Update.
+ (score7_epilogue): Update.
+ * config/score/score.h (FRAME_POINTER_REQUIRED): Update.
+ * config/arm/linux-elf.h (SUBTARGET_FRAME_POINTER_REQUIRED): Update.
+ * config/arm/arm.c (use_return_insn): Update.
+ (require_pic_register): Update.
+ (arm_load_pic_register): Update.
+ (arm_compute_save_reg0_reg12_mask): Update.
+ (arm_compute_save_reg_mask): Update.
+ (thumb1_compute_save_reg_mask): Update.
+ (output_return_instruction): Update.
+ (arm_output_function_prologue): Update.
+ (arm_output_epilogue): Update.
+ (arm_get_frame_offsets): Update.
+ (arm_expand_prologue): Update.
+ (thumb_pushpop): Update.
+ (thumb_exit): Update.
+ (thumb1_expand_prologue): Update.
+ (thumb1_expand_epilogue): Update.
+ (arm_unwind_emit): Update.
+ (arm_output_fn_unwind): Update.
+ * config/arm/arm.h (FRAME_POINTER_REQUIRED): Update.
+ * config/arm/arm.md: Update.
+ * config/pa/pa.md: Update.
+ * config/pa/pa.c (legitimize_pic_address): Update.
+ (compute_frame_size): Update.
+ (hppa_expand_prologue): Update.
+ (hppa_expand_epilogue): Update.
+ (borx_reg_operand): Update.
+ * config/pa/pa.h (FRAME_POINTER_REQUIRED): Update.
+ (HARD_REGNO_RENAME_OK): Update.
+ * config/mips/mips.c (mips_global_pointer): Update.
+ (mips_save_reg_p): Update.
+ (mips_compute_frame_info): Update.
+ (mips_frame_pointer_required): Update.
+ (mips_expand_prologue): Update.
+ (mips_expand_epilogue): Update.
+ (mips_can_use_return_insn): Update.
+ (mips_reorg_process_insns): Update.
+ * config/v850/v850.c (compute_register_save_size): Update.
+ * config/mmix/mmix.h (FRAME_POINTER_REQUIRED): Update.
+ * config/mmix/mmix.c (along): Update.
+ (mmix_expand_epilogue): Update.
+ * config/bfin/bfin.c (legitimize_pic_address): Update.
+ (must_save_p): Update.
+ (stack_frame_needed_p): Update.
+ (add_to_reg): Update.
+ (bfin_expand_prologue): Update.
+ * stmt.c (expand_asm_operands): Update.
+ * reload1.c (reload): Update.
+ (init_elim_table): Update.
+
2008-04-25 Bob Wilson <bob.wilson@acm.org>
* optabs.c (expand_float): Fix REG_EQUAL for UNSIGNED_FLOAT libcall.
note_other_use_this_block (regno, info.users_this_bb);
}
/* Check for the blockage emitted by expand_nl_goto_receiver. */
- else if (current_function_has_nonlocal_label
+ else if (cfun->has_nonlocal_label
&& GET_CODE (PATTERN (insn)) == UNSPEC_VOLATILE)
{
btr_user user;
tem = hard_frame_pointer_rtx;
/* Tell reload not to eliminate the frame pointer. */
- current_function_accesses_prior_frames = 1;
+ crtl->accesses_prior_frames = 1;
}
#endif
/* Tell optimize_save_area_alloca that extra work is going to
need to go on during alloca. */
- current_function_calls_setjmp = 1;
+ cfun->calls_setjmp = 1;
/* We have a nonlocal label. */
- current_function_has_nonlocal_label = 1;
+ cfun->has_nonlocal_label = 1;
}
/* Construct the trailing part of a __builtin_setjmp call. This is
r_sp = gen_rtx_MEM (STACK_SAVEAREA_MODE (SAVE_NONLOCAL),
plus_constant (r_save_area, GET_MODE_SIZE (Pmode)));
- current_function_has_nonlocal_goto = 1;
+ crtl->has_nonlocal_goto = 1;
#ifdef HAVE_nonlocal_goto
/* ??? We no longer need to pass the static chain value, afaik. */
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
}
\f
/* Emit diagnostics that require gimple input for detection. Operate on
{
REG_NOTES (call_insn) = gen_rtx_EXPR_LIST (REG_SETJMP, const0_rtx,
REG_NOTES (call_insn));
- current_function_calls_setjmp = 1;
+ cfun->calls_setjmp = 1;
}
SIBLING_CALL_P (call_insn) = ((ecf_flags & ECF_SIBCALL) != 0);
type_arg_types = TYPE_ARG_TYPES (funtype);
if (flags & ECF_MAY_BE_ALLOCA)
- current_function_calls_alloca = 1;
+ cfun->calls_alloca = 1;
/* If struct_value_rtx is 0, it means pass the address
as if it were an extra parameter. Put the argument expression
if (crtl->preferred_stack_boundary < preferred_stack_boundary
&& fndecl != current_function_decl)
crtl->preferred_stack_boundary = preferred_stack_boundary;
- if (fndecl == current_function_decl)
- cfun->recursive_call_emit = true;
preferred_unit_stack_boundary = preferred_stack_boundary / BITS_PER_UNIT;
if (tail_call_insns)
{
emit_insn (tail_call_insns);
- cfun->tail_call_emit = true;
+ crtl->tail_call_emit = true;
}
else
emit_insn (normal_call_insns);
{
delete_unreachable_blocks ();
- if (cfun->tail_call_emit)
+ if (crtl->tail_call_emit)
fixup_tail_calls ();
return 0;
}
stack guard: protect-all, alloca used, protected decls present. */
if (flag_stack_protect == 2
|| (flag_stack_protect
- && (current_function_calls_alloca || has_protected_decls)))
+ && (cfun->calls_alloca || has_protected_decls)))
create_stack_guard ();
/* Assign rtl to each variable based on these partitions. */
/* Honor stack protection warnings. */
if (warn_stack_protect)
{
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
warning (OPT_Wstack_protector,
"not protecting local variables: variable length buffer");
if (has_short_buffer && !crtl->stack_protect_guard)
return 0;
}
-struct gimple_opt_pass pass_expand =
+struct rtl_opt_pass pass_expand =
{
{
- GIMPLE_PASS,
+ RTL_PASS,
"expand", /* name */
NULL, /* gate */
tree_expand_cfg, /* execute */
/* When outputting a thunk, we don't have valid register life info,
but assemble_start_function wants to output .frame and .mask
directives. */
- if (current_function_is_thunk)
+ if (crtl->is_thunk)
{
*imaskP = 0;
*fmaskP = 0;
}
/* We need to restore these for the handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
for (i = 0; ; ++i)
{
alpha_procedure_type
= (sa_size || get_frame_size() != 0
|| crtl->outgoing_args_size
- || current_function_stdarg || current_function_calls_alloca
+ || cfun->stdarg || cfun->calls_alloca
|| frame_pointer_needed)
? PT_STACK : PT_REGISTER;
vms_base_regno
= (frame_pointer_needed
- || current_function_has_nonlocal_label
+ || cfun->has_nonlocal_label
|| alpha_procedure_type == PT_STACK
|| crtl->outgoing_args_size)
? REG_PV : HARD_FRAME_POINTER_REGNUM;
return 0;
/* We need the gp to load the address of __mcount. */
- if (TARGET_PROFILING_NEEDS_GP && current_function_profile)
+ if (TARGET_PROFILING_NEEDS_GP && crtl->profile)
return 1;
/* The code emitted by alpha_output_mi_thunk_osf uses the gp. */
- if (current_function_is_thunk)
+ if (crtl->is_thunk)
return 1;
/* The nonlocal receiver pattern assumes that the gp is valid for
the nested function. Reasonable because it's almost always set
correctly already. For the cases where that's wrong, make sure
the nested function loads its gp on entry. */
- if (current_function_has_nonlocal_goto)
+ if (crtl->has_nonlocal_goto)
return 1;
/* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
the call to mcount ourselves, rather than having the linker do it
magically in response to -pg. Since _mcount has special linkage,
don't represent the call as a call. */
- if (TARGET_PROFILING_NEEDS_GP && current_function_profile)
+ if (TARGET_PROFILING_NEEDS_GP && crtl->profile)
emit_insn (gen_prologue_mcount ());
if (TARGET_ABI_UNICOSMK)
Otherwise, do it here. */
if (TARGET_ABI_OSF
&& ! alpha_function_needs_gp
- && ! current_function_is_thunk)
+ && ! crtl->is_thunk)
{
putc ('$', file);
assemble_name (file, fnname);
fputs ("\t.prologue 0\n", file);
else if (!flag_inhibit_size_directive)
fprintf (file, "\t.prologue %d\n",
- alpha_function_needs_gp || current_function_is_thunk);
+ alpha_function_needs_gp || crtl->is_thunk);
}
/* Write function epilogue. */
fp_offset = 0;
sa_reg = stack_pointer_rtx;
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
eh_ofs = EH_RETURN_STACKADJ_RTX;
else
eh_ofs = NULL_RTX;
register so as not to interfere with a potential fp restore,
which must be consecutive with an SP restore. */
if (frame_size < 32768
- && ! (TARGET_ABI_UNICOSMK && current_function_calls_alloca))
+ && ! (TARGET_ABI_UNICOSMK && cfun->calls_alloca))
sp_adj2 = GEN_INT (frame_size);
else if (TARGET_ABI_UNICOSMK)
{
tree op_decl, cfun_sec, op_sec;
/* If profiling is implemented via linker tricks, we can't jump
- to the nogp alternate entry point. Note that current_function_profile
+ to the nogp alternate entry point. Note that crtl->profile
would not be correct, since that doesn't indicate if the target
function uses profiling. */
/* ??? TARGET_PROFILING_NEEDS_GP isn't really the right test,
unsigned int pretend_size = current_frame_info.pretend_size;
unsigned int frame_size = size - pretend_size;
int restored, fp_restored_p;
- int can_trust_sp_p = !current_function_calls_alloca;
+ int can_trust_sp_p = !cfun->calls_alloca;
const char *sp_str = reg_names[STACK_POINTER_REGNUM];
const char *fp_str = reg_names[FRAME_POINTER_REGNUM];
frame pointer. This expression is evaluated in the reload pass.
If its value is nonzero the function will have a frame pointer. */
#define FRAME_POINTER_REQUIRED \
-(current_function_calls_alloca)
+(cfun->calls_alloca)
/* C statement to store the difference between the frame pointer
and the stack pointer values immediately after the function prologue. */
if (crtl->args.pretend_args_size
|| cfun->machine->uses_anonymous_args
/* Or if the function calls __builtin_eh_return () */
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
/* Or if the function calls alloca */
- || current_function_calls_alloca
+ || cfun->calls_alloca
/* Or if there is a stack adjustment. However, if the stack pointer
is saved on the stack, we can use a pre-incrementing stack load. */
|| !(stack_adjust == 0 || (TARGET_APCS_FRAME && frame_pointer_needed
We don't want those calls to affect any assumptions about the real
function; and further, we can't call entry_of_function() until we
start the real expansion process. */
- if (!current_function_uses_pic_offset_table)
+ if (!crtl->uses_pic_offset_table)
{
gcc_assert (can_create_pseudo_p ());
if (arm_pic_register != INVALID_REGNUM)
if we are being called as part of the cost-estimation
process. */
if (current_ir_type () != IR_GIMPLE)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}
else
{
process. */
if (current_ir_type () != IR_GIMPLE)
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
start_sequence ();
arm_load_pic_register (0UL);
rtx l1, labelno, pic_tmp, pic_tmp2, pic_rtx, pic_reg;
rtx global_offset_table;
- if (current_function_uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE)
+ if (crtl->uses_pic_offset_table == 0 || TARGET_SINGLE_PIC_BASE)
return;
gcc_assert (flag_pic);
if (flag_pic
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
}
else
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
&& (df_regs_ever_live_p (PIC_OFFSET_TABLE_REGNUM)
- || current_function_uses_pic_offset_table))
+ || crtl->uses_pic_offset_table))
save_reg_mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
/* The prologue will copy SP into R0, so save it. */
}
/* Save registers so the exception handler can modify them. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
|| (save_reg_mask
&& optimize_size
&& ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL
- && !current_function_calls_eh_return))
+ && !crtl->calls_eh_return))
save_reg_mask |= 1 << LR_REGNUM;
if (cfun->machine->lr_save_eliminated)
if (flag_pic
&& !TARGET_SINGLE_PIC_BASE
&& arm_pic_register != INVALID_REGNUM
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
mask |= 1 << PIC_OFFSET_TABLE_REGNUM;
/* See if we might need r11 for calls to _interwork_r11_call_via_rN(). */
return "";
}
- gcc_assert (!current_function_calls_alloca || really_return);
+ gcc_assert (!cfun->calls_alloca || really_return);
sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd');
if (cfun->machine->lr_save_eliminated)
asm_fprintf (f, "\t%@ link register save eliminated.\n");
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\t@ Calls __builtin_eh_return.\n");
return_used_this_function = 0;
/* If we are throwing an exception, then we really must be doing a
return, so we can't tail-call. */
- gcc_assert (!current_function_calls_eh_return || really_return);
+ gcc_assert (!crtl->calls_eh_return || really_return);
offsets = arm_get_frame_offsets ();
saved_regs_mask = offsets->saved_regs_mask;
special function exit sequence, or we are not really returning. */
if (really_return
&& ARM_FUNC_TYPE (func_type) == ARM_FT_NORMAL
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
/* Delete the LR from the register mask, so that the LR on
the stack is loaded into the PC in the register mask. */
saved_regs_mask &= ~ (1 << LR_REGNUM);
occur. If the stack pointer already points at the right
place, then omit the subtraction. */
if (offsets->outgoing_args != (1 + (int) bit_count (saved_regs_mask))
- || current_function_calls_alloca)
+ || cfun->calls_alloca)
asm_fprintf (f, "\tsub\t%r, %r, #%d\n", SP_REGNUM, FP_REGNUM,
4 * bit_count (saved_regs_mask));
print_multi_reg (f, "ldmfd\t%r, ", SP_REGNUM, saved_regs_mask, 0);
count = offsets->saved_regs - offsets->saved_args;
if (optimize_size
&& count != 0
- && !current_function_calls_eh_return
+ && !crtl->calls_eh_return
&& bit_count(saved_regs_mask) * 4 == count
&& !IS_INTERRUPT (func_type)
- && !cfun->tail_call_emit)
+ && !crtl->tail_call_emit)
{
unsigned long mask;
mask = (1 << (arm_size_return_regs() / 4)) - 1;
&& really_return
&& crtl->args.pretend_args_size == 0
&& saved_regs_mask & (1 << LR_REGNUM)
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
{
saved_regs_mask &= ~ (1 << LR_REGNUM);
saved_regs_mask |= (1 << PC_REGNUM);
return "";
/* Stack adjustment for exception handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\tadd\t%r, %r, %r\n", SP_REGNUM, SP_REGNUM,
ARM_EH_STACKADJ_REGNUM);
}
if (reg == -1 && arm_size_return_regs () <= 12
- && !cfun->tail_call_emit)
+ && !crtl->tail_call_emit)
{
/* Push/pop an argument register (r3) if all callee saved
registers are already being pushed. */
scheduling in the prolog. Similarly if we want non-call exceptions
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
- if (current_function_profile || !TARGET_SCHED_PROLOG
+ if (crtl->profile || !TARGET_SCHED_PROLOG
|| (ARM_EABI_UNWIND_TABLES && flag_non_call_exceptions))
emit_insn (gen_blockage ());
{
/* Catch popping the PC. */
if (TARGET_INTERWORK || TARGET_BACKTRACE
- || current_function_calls_eh_return)
+ || crtl->calls_eh_return)
{
/* The PC is never poped directly, instead
it is popped into r3 and then BX is used. */
return. */
if (pops_needed == 0)
{
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM);
asm_fprintf (f, "\tbx\t%r\n", reg_containing_return_addr);
else if (!TARGET_INTERWORK
&& !TARGET_BACKTRACE
&& !is_called_in_ARM_mode (current_function_decl)
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
{
asm_fprintf (f, "\tpop\t{%r}\n", PC_REGNUM);
return;
/* If returning via __builtin_eh_return, the bottom three registers
all contain information needed for the return. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
size = 12;
else
{
asm_fprintf (f, "\tmov\t%r, %r\n", LAST_ARG_REGNUM, IP_REGNUM);
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
asm_fprintf (f, "\tadd\t%r, %r\n", SP_REGNUM, ARM_EH_STACKADJ_REGNUM);
/* Return to caller. */
scheduling in the prolog. Similarly if we want non-call exceptions
using the EABI unwinder, to prevent faulting instructions from being
swapped with a stack adjustment. */
- if (current_function_profile || !TARGET_SCHED_PROLOG
+ if (crtl->profile || !TARGET_SCHED_PROLOG
|| (ARM_EABI_UNWIND_TABLES && flag_non_call_exceptions))
emit_insn (gen_blockage ());
the stack adjustment will not be deleted. */
emit_insn (gen_prologue_use (stack_pointer_rtx));
- if (current_function_profile || !TARGET_SCHED_PROLOG)
+ if (crtl->profile || !TARGET_SCHED_PROLOG)
emit_insn (gen_blockage ());
/* Emit a clobber for each insn that will be restored in the epilogue,
if (!ARM_EABI_UNWIND_TABLES)
return;
- if (!(flag_unwind_tables || cfun->uses_eh_lsda)
+ if (!(flag_unwind_tables || crtl->uses_eh_lsda)
&& (TREE_NOTHROW (current_function_decl)
|| cfun->all_throwers_are_sibcalls))
return;
/* If this function will never be unwound, then mark it as such.
The came condition is used in arm_unwind_emit to suppress
the frame annotations. */
- if (!(flag_unwind_tables || cfun->uses_eh_lsda)
+ if (!(flag_unwind_tables || crtl->uses_eh_lsda)
&& (TREE_NOTHROW (current_function_decl)
|| cfun->all_throwers_are_sibcalls))
fputs("\t.cantunwind\n", f);
#endif
#define FRAME_POINTER_REQUIRED \
- (current_function_has_nonlocal_label \
+ (cfun->has_nonlocal_label \
|| SUBTARGET_FRAME_POINTER_REQUIRED \
|| (TARGET_ARM && TARGET_APCS_FRAME && ! leaf_function_p ()))
{ \
if (is_called_in_ARM_mode (DECL) \
|| (TARGET_THUMB1 && !TARGET_THUMB1_ONLY \
- && current_function_is_thunk)) \
+ && crtl->is_thunk)) \
fprintf (STREAM, "\t.code 32\n") ; \
else if (TARGET_THUMB1) \
fprintf (STREAM, "\t.code\t16\n\t.thumb_func\n") ; \
[(clobber (const_int 0))]
"TARGET_EITHER"
"
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_prologue_use (gen_rtx_REG (Pmode, 2)));
if (TARGET_THUMB1)
thumb1_expand_epilogue ();
emit_insn (gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (SImode, LR_REGNUM)))
/* The GNU/Linux profiler needs a frame pointer. */
-#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
+#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
/* Add .note.GNU-stack. */
#undef NEED_INDICATE_EXEC_STACK
int
frame_pointer_required_p (void)
{
- return (current_function_calls_alloca
+ return (cfun->calls_alloca
|| crtl->args.info.nregs == 0
|| get_frame_size () > 0);
}
emit_move_insn (reg, new);
if (picreg == pic_offset_table_rtx)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return reg;
}
if (D_REGNO_P (regno))
{
bool is_eh_return_reg = false;
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned j;
for (j = 0; ; j++)
&& (is_inthandler || !call_used_regs[regno]))
|| (!TARGET_FDPIC
&& regno == PIC_OFFSET_TABLE_REGNUM
- && (current_function_uses_pic_offset_table
+ && (crtl->uses_pic_offset_table
|| (TARGET_ID_SHARED_LIBRARY && !current_function_is_leaf))));
}
else
{
/* EH return puts a new return address into the frame using an
address relative to the frame pointer. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
return true;
return frame_pointer_needed;
}
if ((df_regs_ever_live_p (i) && ! call_used_regs[i])
|| (!TARGET_FDPIC
&& i == PIC_OFFSET_TABLE_REGNUM
- && (current_function_uses_pic_offset_table
+ && (crtl->uses_pic_offset_table
|| (TARGET_ID_SHARED_LIBRARY
&& ! current_function_is_leaf))))
break;
return;
}
- if (current_function_limit_stack
+ if (crtl->limit_stack
|| TARGET_STACK_CHECK_L1)
{
HOST_WIDE_INT offset
= bfin_initial_elimination_offset (ARG_POINTER_REGNUM,
STACK_POINTER_REGNUM);
- rtx lim = current_function_limit_stack ? stack_limit_rtx : NULL_RTX;
+ rtx lim = crtl->limit_stack ? stack_limit_rtx : NULL_RTX;
rtx p2reg = gen_rtx_REG (Pmode, REG_P2);
if (!lim)
if (TARGET_ID_SHARED_LIBRARY
&& !TARGET_SEP_DATA
- && (current_function_uses_pic_offset_table
+ && (crtl->uses_pic_offset_table
|| !current_function_is_leaf))
bfin_load_pic_reg (pic_offset_table_rtx);
}
reg_names[CRIS_CC0_REGNUM] = "ccr";
}
-/* Return current_function_uses_pic_offset_table. For use in cris.md,
+/* Return crtl->uses_pic_offset_table. For use in cris.md,
since some generated files do not include function.h. */
int
cris_cfun_uses_pic_table (void)
{
- return current_function_uses_pic_offset_table;
+ return crtl->uses_pic_offset_table;
}
/* Given an rtx, return the text string corresponding to the CODE of X.
&& !call_used_regs[regno + 1]))))
&& (regno != FRAME_POINTER_REGNUM || !frame_pointer_needed)
&& regno != CRIS_SRP_REGNUM)
- || (current_function_calls_eh_return
+ || (crtl->calls_eh_return
&& (regno == EH_RETURN_DATA_REGNO (0)
|| regno == EH_RETURN_DATA_REGNO (1)
|| regno == EH_RETURN_DATA_REGNO (2)
int offs = 0;
bool got_really_used = false;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
push_topmost_sequence ();
got_really_used
|| crtl->args.pretend_args_size
|| crtl->args.size
|| crtl->outgoing_args_size
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
/* If we're not supposed to emit prologue and epilogue, we must
not emit return-type instructions. */
if (TARGET_V32 && cris_return_address_on_stack ())
return false;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
push_topmost_sequence ();
got_really_used
CRIS_ASSERT (size >= 0);
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
/* A reference may have been optimized out (like the abort () in
fde_split in unwind-dw2-fde.c, at least 3.2.1) so check that
if (!TARGET_PROLOGUE_EPILOGUE)
return;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
{
/* A reference may have been optimized out (like the abort () in
fde_split in unwind-dw2-fde.c, at least 3.2.1) so check that
the return address on the stack. */
if (return_address_on_stack && pretend == 0)
{
- if (TARGET_V32 || current_function_calls_eh_return)
+ if (TARGET_V32 || crtl->calls_eh_return)
{
rtx mem;
rtx insn;
REG_NOTES (insn)
= alloc_EXPR_LIST (REG_INC, stack_pointer_rtx, REG_NOTES (insn));
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
gen_rtx_raw_REG (SImode,
}
/* Perform the "physical" unwinding that the EH machinery calculated. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
gen_rtx_raw_REG (SImode,
for v32. */
rtx tem, rm, ro;
gcc_assert (can_create_pseudo_p ());
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op),
TARGET_V32
? CRIS_UNSPEC_PLT_PCREL
rtx tem, mem, rm, ro;
gcc_assert (can_create_pseudo_p ());
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op),
CRIS_UNSPEC_PLTGOTREAD);
rm = gen_reg_rtx (Pmode);
assemble_name (file, str);
/* Sanity check. */
- if (!TARGET_V32 && !current_function_uses_pic_offset_table)
+ if (!TARGET_V32 && !crtl->uses_pic_offset_table)
output_operand_lossage ("PIC register isn't set up");
}
else
assemble_name (file, buf);
/* Sanity check. */
- if (!TARGET_V32 && !current_function_uses_pic_offset_table)
+ if (!TARGET_V32 && !crtl->uses_pic_offset_table)
internal_error ("emitting PIC operand, but PIC register isn't set up");
}
else
/* FIXME: add a REG_EQUAL (or is it REG_EQUIV) note to the
destination register for the symbol. It might not be
worth it. Measure. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (t == cris_rel_symbol)
{
/* Change a "move.d sym(+offs),rN" into (allocate register rM)
{
/* We still uses GOT-relative addressing for
pre-v32. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
tem = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, sym),
CRIS_UNSPEC_GOTREL);
if (offs != 0)
#define FIRST_PARM_OFFSET(FNDECL) 0
-#define FRAME_POINTER_REQUIRED (current_function_calls_alloca)
+#define FRAME_POINTER_REQUIRED (cfun->calls_alloca)
#define ELIMINABLE_REGS \
{ \
if (function_base == NULL)
function_base = ggc_alloc_string ("<pic base>", sizeof ("<pic base>"));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return function_base;
}
&& ! call_used_regs [regno] )
#define MUST_SAVE_FRAME_POINTER (df_regs_ever_live_p (FRAME_POINTER_REGNUM) || frame_pointer_needed)
-#define MUST_SAVE_RETURN_POINTER (df_regs_ever_live_p (RETURN_POINTER_REGNUM) || current_function_profile)
+#define MUST_SAVE_RETURN_POINTER (df_regs_ever_live_p (RETURN_POINTER_REGNUM) || crtl->profile)
#if UNITS_PER_WORD == 4
#define WORD_ALIGN(SIZE) (((SIZE) + 3) & ~3)
RTX_FRAME_RELATED_P (insn) = 1;
}
- if (current_function_profile)
+ if (crtl->profile)
emit_insn (gen_blockage ());
}
for (regno = first; regno <= last; regno++)
{
if ((df_regs_ever_live_p (regno) && !call_used_regs[regno])
- || (current_function_calls_eh_return
+ || (crtl->calls_eh_return
&& (regno >= FIRST_EH_REGNUM && regno <= LAST_EH_REGNUM))
|| (!TARGET_FDPIC && flag_pic
&& cfun->uses_pic_offset_table && regno == PIC_REGNO))
}
/* If this function uses eh_return, add the final stack adjustment now. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_stack_adjust (sp, sp, EH_RETURN_STACKADJ_RTX));
if (emit_return)
|| ix86_current_function_calls_tls_descriptor))
return 1;
- if (current_function_profile)
+ if (crtl->profile)
return 1;
return 0;
static unsigned int
ix86_select_alt_pic_regnum (void)
{
- if (current_function_is_leaf && !current_function_profile
+ if (current_function_is_leaf && !crtl->profile
&& !ix86_current_function_calls_tls_descriptor)
{
int i;
if (pic_offset_table_rtx
&& regno == REAL_PIC_OFFSET_TABLE_REGNUM
&& (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
- || current_function_profile
- || current_function_calls_eh_return
- || current_function_uses_const_pool))
+ || crtl->profile
+ || crtl->calls_eh_return
+ || crtl->uses_const_pool))
{
if (ix86_select_alt_pic_regnum () != INVALID_REGNUM)
return 0;
return 1;
}
- if (current_function_calls_eh_return && maybe_eh_return)
+ if (crtl->calls_eh_return && maybe_eh_return)
{
unsigned i;
for (i = 0; ; i++)
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
+ && (!current_function_is_leaf || cfun->calls_alloca
|| ix86_current_function_calls_tls_descriptor))
{
offset += crtl->outgoing_args_size;
/* Align stack boundary. Only needed if we're calling another function
or using alloca. */
- if (!current_function_is_leaf || current_function_calls_alloca
+ if (!current_function_is_leaf || cfun->calls_alloca
|| ix86_current_function_calls_tls_descriptor)
frame->padding2 = ((offset + preferred_alignment - 1)
& -preferred_alignment) - offset;
(long)frame->hard_frame_pointer_offset);
fprintf (stderr, "stack_pointer_offset: %ld\n", (long)frame->stack_pointer_offset);
fprintf (stderr, "current_function_is_leaf: %ld\n", (long)current_function_is_leaf);
- fprintf (stderr, "current_function_calls_alloca: %ld\n", (long)current_function_calls_alloca);
+ fprintf (stderr, "cfun->calls_alloca: %ld\n", (long)cfun->calls_alloca);
fprintf (stderr, "x86_current_function_calls_tls_descriptor: %ld\n", (long)ix86_current_function_calls_tls_descriptor);
#endif
}
pic_reg_used = false;
if (pic_offset_table_rtx
&& (df_regs_ever_live_p (REAL_PIC_OFFSET_TABLE_REGNUM)
- || current_function_profile))
+ || crtl->profile))
{
unsigned int alt_pic_reg_used = ix86_select_alt_pic_regnum ();
/* Prevent function calls from being scheduled before the call to mcount.
In the pic_reg_used case, make sure that the got load isn't deleted. */
- if (current_function_profile)
+ if (crtl->profile)
{
if (pic_reg_used)
emit_insn (gen_prologue_use (pic_offset_table_rtx));
eh_return: the eax and edx registers are marked as saved, but not
restored along this path. */
offset = frame.nregs;
- if (current_function_calls_eh_return && style != 2)
+ if (crtl->calls_eh_return && style != 2)
offset -= 2;
offset *= -UNITS_PER_WORD;
|| (frame_pointer_needed && TARGET_USE_LEAVE
&& cfun->machine->use_fast_prologue_epilogue
&& frame.nregs == 1)
- || current_function_calls_eh_return)
+ || crtl->calls_eh_return)
{
/* Restore registers. We can use ebp or esp to address the memory
locations. If both are available, default to ebp, since offsets
frame, so we cannot allow profiling without a frame pointer. */
#undef SUBTARGET_FRAME_POINTER_REQUIRED
-#define SUBTARGET_FRAME_POINTER_REQUIRED current_function_profile
+#define SUBTARGET_FRAME_POINTER_REQUIRED crtl->profile
#undef SIZE_TYPE
#define SIZE_TYPE "unsigned int"
Likewise for -a profiling for the bb_init_func argument. For -ax
profiling, we need two output registers for the two bb_init_trace_func
arguments. */
- if (current_function_profile)
+ if (crtl->profile)
i = MAX (i, 1);
#endif
current_frame_info.n_output_regs = i;
/* Similarly for gp. Note that if we're calling setjmp, the stacked
registers are clobbered, so we fall back to the stack. */
current_frame_info.r[reg_save_gp]
- = (current_function_calls_setjmp ? 0 : find_gr_spill (reg_save_gp, 1));
+ = (cfun->calls_setjmp ? 0 : find_gr_spill (reg_save_gp, 1));
if (current_frame_info.r[reg_save_gp] == 0)
{
SET_HARD_REG_BIT (mask, GR_REG (1));
/* ??? This happens if we cse/gcse a BImode value across a call,
and the function has a nonlocal goto. This is because global
does not allocate call crossing pseudos to hard registers when
- current_function_has_nonlocal_goto is true. This is relatively
+ crtl->has_nonlocal_goto is true. This is relatively
common for C++ programs that use exceptions. To reproduce,
return NO_REGS and compile libstdc++. */
if (GET_CODE (x) == MEM)
/* If a function dynamically allocates the stack and
has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space. */
- if (args_size == 0 && current_function_calls_alloca)
+ if (args_size == 0 && cfun->calls_alloca)
args_size = 4 * UNITS_PER_WORD;
total_size = var_size + args_size + extra_size;
}
/* We need to restore these for the handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
save_restore_insns (0);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
rtx eh_ofs = EH_RETURN_STACKADJ_RTX;
emit_insn (gen_addsi3 (eh_ofs, eh_ofs, tsize_rtx));
emit_insn (gen_blockage ());
- if (tsize != 0 || current_function_calls_eh_return)
+ if (tsize != 0 || crtl->calls_eh_return)
{
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
tsize_rtx));
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
/* Perform the additional bump for __throw. */
emit_move_insn (gen_rtx_REG (Pmode, HARD_FRAME_POINTER_REGNUM),
&& (df_regs_ever_live_p (regno) && (!call_really_used_regs[regno] || interrupt_p)))
#define MUST_SAVE_FRAME_POINTER (df_regs_ever_live_p (FRAME_POINTER_REGNUM))
-#define MUST_SAVE_RETURN_ADDR (df_regs_ever_live_p (RETURN_ADDR_REGNUM) || current_function_profile)
+#define MUST_SAVE_RETURN_ADDR (df_regs_ever_live_p (RETURN_ADDR_REGNUM) || crtl->profile)
#define SHORT_INSN_SIZE 2 /* Size of small instructions. */
#define LONG_INSN_SIZE 4 /* Size of long instructions. */
unsigned int gmask;
enum m32r_function_type fn_type;
int interrupt_p;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- | current_function_profile);
+ int pic_reg_used = flag_pic && (crtl->uses_pic_offset_table
+ | crtl->profile);
var_size = M32R_STACK_ALIGN (size);
args_size = M32R_STACK_ALIGN (crtl->outgoing_args_size);
int regno;
int frame_size;
unsigned int gmask;
- int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table
- | current_function_profile);
+ int pic_reg_used = flag_pic && (crtl->uses_pic_offset_table
+ | crtl->profile);
if (! current_frame_info.initialized)
m32r_compute_frame_size (get_frame_size ());
if (frame_pointer_needed)
emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx));
- if (current_function_profile)
+ if (crtl->profile)
/* Push lr for mcount (form_pc, x). */
emit_insn (gen_movsi_push (stack_pointer_rtx,
gen_rtx_REG (Pmode, RETURN_ADDR_REGNUM)));
{
m32r_load_pic_register ();
m32r_reload_lr (stack_pointer_rtx,
- (current_function_profile ? 0 : frame_size));
+ (crtl->profile ? 0 : frame_size));
}
- if (current_function_profile && !pic_reg_used)
+ if (crtl->profile && !pic_reg_used)
emit_insn (gen_blockage ());
}
unsigned int var_size = current_frame_info.var_size;
unsigned int args_size = current_frame_info.args_size;
unsigned int gmask = current_frame_info.gmask;
- int can_trust_sp_p = !current_function_calls_alloca;
+ int can_trust_sp_p = !cfun->calls_alloca;
if (flag_exceptions)
emit_insn (gen_blockage ());
else
address = reg;
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (GET_CODE (orig) == LABEL_REF
|| (GET_CODE (orig) == SYMBOL_REF && SYMBOL_REF_LOCAL_P (orig)))
/* A C expression which is nonzero if a function must have and use a
frame pointer. This expression is evaluated in the reload pass.
If its value is nonzero the function will have a frame pointer. */
-#define FRAME_POINTER_REQUIRED current_function_calls_alloca
+#define FRAME_POINTER_REQUIRED cfun->calls_alloca
#if 0
/* C statement to store the difference between the frame pointer
"
{
if (flag_pic)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}")
(define_insn "*call_via_reg"
"
{
if (flag_pic)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}")
(define_insn "*call_value_via_reg"
int call26_p = call26_operand (operands[1], FUNCTION_MODE);
if (flag_pic)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (! call26_p)
{
{
if (flag_pic && regno == PIC_REG)
{
- if (current_function_saves_all_registers)
+ if (crtl->saves_all_registers)
return true;
- if (current_function_uses_pic_offset_table)
+ if (crtl->uses_pic_offset_table)
return true;
/* Reload may introduce constant pool references into a function
that thitherto didn't need a PIC register. Note that the test
above will not catch that case because we will only set
- current_function_uses_pic_offset_table when emitting
+ crtl->uses_pic_offset_table when emitting
the address reloads. */
- if (current_function_uses_const_pool)
+ if (crtl->uses_const_pool)
return true;
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0; ; i++)
/* If the stack limit is a symbol, we can check it here,
before actually allocating the space. */
- if (current_function_limit_stack
+ if (crtl->limit_stack
&& GET_CODE (stack_limit_rtx) == SYMBOL_REF)
{
limit = plus_constant (stack_limit_rtx, current_frame.size + 4);
/* If the stack limit is not a symbol, check it here.
This has the disadvantage that it may be too late... */
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
if (REG_P (stack_limit_rtx))
{
if (flag_pic
&& !TARGET_SEP_DATA
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
insn = emit_insn (gen_load_got (pic_offset_table_rtx));
}
\f
What we really need to know there is if there could be pending
stack adjustment needed at that point. */
restore_from_sp = (!frame_pointer_needed
- || (!current_function_calls_alloca
+ || (!cfun->calls_alloca
&& current_function_is_leaf));
/* fsize_with_regs is the size we need to adjust the sp when
stack_pointer_rtx,
GEN_INT (fsize_with_regs)));
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_addsi3 (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
pic_ref = gen_rtx_MEM (Pmode,
gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, orig));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
MEM_READONLY_P (pic_ref) = 1;
emit_move_insn (reg, pic_ref);
return reg;
ASM_OUTPUT_CG_NODE (asm_out_file, mcore_current_function_name, space_allocated);
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
ASM_OUTPUT_CG_EDGE (asm_out_file, mcore_current_function_name, "alloca", 1);
/* 970425: RBE:
/* FUNCTION_PROFILER includes a jal macro, so we need to give it
a valid gp. */
- if (current_function_profile)
+ if (crtl->profile)
return GLOBAL_POINTER_REGNUM;
/* If the function has a nonlocal goto, $gp must hold the correct
global pointer for the target function. */
- if (current_function_has_nonlocal_goto)
+ if (crtl->has_nonlocal_goto)
return GLOBAL_POINTER_REGNUM;
/* If the gp is never referenced, there's no need to initialize it.
In cases like these, reload will have added the constant to the pool
but no instruction will yet refer to it. */
if (!df_regs_ever_live_p (GLOBAL_POINTER_REGNUM)
- && !current_function_uses_const_pool
+ && !crtl->uses_const_pool
&& !mips_function_has_gp_insn ())
return 0;
return TARGET_CALL_SAVED_GP && cfun->machine->global_pointer == regno;
/* Check call-saved registers. */
- if ((current_function_saves_all_registers || df_regs_ever_live_p (regno))
+ if ((crtl->saves_all_registers || df_regs_ever_live_p (regno))
&& !call_really_used_regs[regno])
return true;
return true;
/* Check for registers that must be saved for FUNCTION_PROFILER. */
- if (current_function_profile && MIPS_SAVE_REG_FOR_PROFILING_P (regno))
+ if (crtl->profile && MIPS_SAVE_REG_FOR_PROFILING_P (regno))
return true;
/* We need to save the incoming return address if it is ever clobbered
value in FPRs. */
if (regno == GP_REG_FIRST + 31
&& (df_regs_ever_live_p (regno)
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
|| mips16_cfun_returns_in_fpr_p ()))
return true;
allocate the stack and have 0 for STACK_DYNAMIC_OFFSET, since it
looks like we are trying to create a second frame pointer to the
function, so allocate some stack space to make it happy. */
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
frame->args_size = REG_PARM_STACK_SPACE (cfun->decl);
else
frame->args_size = 0;
/* If this function calls eh_return, we must also save and restore the
EH data registers. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM; i++)
{
frame->num_gp++;
{
/* If the function contains dynamic stack allocations, we need to
use the frame pointer to access the static parts of the frame. */
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
return true;
/* In MIPS16 mode, we need a frame pointer for a large frame; otherwise,
/* If we are profiling, make sure no instructions are scheduled before
the call to mcount. */
- if (current_function_profile)
+ if (crtl->profile)
emit_insn (gen_blockage ());
}
\f
/* Add in the __builtin_eh_return stack adjustment. We need to
use a temporary in MIPS16 code. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
if (TARGET_MIPS16)
{
if (!reload_completed)
return false;
- if (current_function_profile)
+ if (crtl->profile)
return false;
/* In MIPS16 mode, a function that returns a floating-point value
/* Profiled functions can't be all noreorder because the profiler
support uses assembler macros. */
- if (current_function_profile)
+ if (crtl->profile)
cfun->machine->all_noreorder_p = false;
/* Code compiled with -mfix-vr4120 can't be all noreorder because
|| !leaf_function_p ()))
#define IS_MMIX_EH_RETURN_DATA_REG(REGNO) \
- (current_function_calls_eh_return \
+ (crtl->calls_eh_return \
&& (EH_RETURN_DATA_REGNO (0) == REGNO \
|| EH_RETURN_DATA_REGNO (1) == REGNO \
|| EH_RETURN_DATA_REGNO (2) == REGNO \
#define MMIX_POP_ARGUMENT() \
((! TARGET_ABI_GNU \
&& crtl->return_rtx != NULL \
- && ! current_function_returns_struct) \
+ && ! cfun->returns_struct) \
? (GET_CODE (crtl->return_rtx) == PARALLEL \
? GET_NUM_ELEM (XVEC (crtl->return_rtx, 0)) : 1) \
: 0)
if (stack_space_to_deallocate != 0)
mmix_emit_sp_add (stack_space_to_deallocate);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
/* Adjust the (normal) stack-pointer to that of the receiver.
FIXME: It would be nice if we could also adjust the register stack
here, but we need to express it through DWARF 2 too. */
/* Node: Elimination */
/* FIXME: Is this requirement built-in? Anyway, we should try to get rid
of it; we can deduce the value. */
-#define FRAME_POINTER_REQUIRED current_function_has_nonlocal_label
+#define FRAME_POINTER_REQUIRED cfun->has_nonlocal_label
/* The frame-pointer is stored in a location that either counts to the
offset of incoming parameters, or that counts to the offset of the
if (! POINTER_TYPE_P (valtype))
return gen_rtx_REG (mode, FIRST_DATA_REGNUM);
else if (! TARGET_PTR_A0D0 || ! outgoing
- || current_function_returns_struct)
+ || cfun->returns_struct)
return gen_rtx_REG (mode, FIRST_ADDRESS_REGNUM);
rv = gen_rtx_PARALLEL (mode, rtvec_alloc (2));
handlers. */ \
|| (interrupt_handler && call_used_regs[regno] \
&& !current_function_is_leaf) \
- ||(current_function_calls_eh_return \
+ ||(crtl->calls_eh_return \
&& (regno == GPR_R7 || regno == GPR_R8)) \
) \
)
REG_NOTES (insn));
LABEL_NUSES (orig)++;
}
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return reg;
}
if (GET_CODE (orig) == SYMBOL_REF)
UNSPEC_DLTIND14R)));
}
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
mark_reg_pointer (reg, BITS_PER_UNIT);
insn = emit_move_insn (reg, pic_ref);
/* If the current function calls __builtin_eh_return, then we need
to allocate stack space for registers that will hold data for
the exception handler. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i;
/* Save RP first. The calling conventions manual states RP will
always be stored into the caller's frame at sp - 20 or sp - 16
depending on which ABI is in use. */
- if (df_regs_ever_live_p (2) || current_function_calls_eh_return)
+ if (df_regs_ever_live_p (2) || crtl->calls_eh_return)
{
store_reg (2, TARGET_64BIT ? -16 : -20, STACK_POINTER_REGNUM);
rp_saved = true;
/* Saving the EH return data registers in the frame is the simplest
way to get the frame unwind information emitted. We put them
just before the general registers. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
/* Saving the EH return data registers in the frame is the simplest
way to get the frame unwind information emitted. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
/* If the current function calls __builtin_eh_return, then we need
to restore the saved EH data registers. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
/* If the current function calls __builtin_eh_return, then we need
to restore the saved EH data registers. */
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
unsigned int i, regno;
if (ret_off != 0)
load_reg (2, ret_off, STACK_POINTER_REGNUM);
- if (DO_FRAME_NOTES && current_function_calls_eh_return)
+ if (DO_FRAME_NOTES && crtl->calls_eh_return)
{
rtx sa = EH_RETURN_STACKADJ_RTX;
profitable to do so when the frame pointer is being eliminated. */
if (!reload_completed
&& flag_omit_frame_pointer
- && !current_function_calls_alloca
+ && !cfun->calls_alloca
&& op == frame_pointer_rtx)
return 0;
/* Value should be nonzero if functions must have frame pointers. */
#define FRAME_POINTER_REQUIRED \
- (current_function_calls_alloca)
+ (cfun->calls_alloca)
/* Don't allow hard registers to be renamed into r2 unless r2
is already live or already being saved (due to eh). */
#define HARD_REGNO_RENAME_OK(OLD_REG, NEW_REG) \
- ((NEW_REG) != 2 || df_regs_ever_live_p (2) || current_function_calls_eh_return)
+ ((NEW_REG) != 2 || df_regs_ever_live_p (2) || crtl->calls_eh_return)
/* C statement to store the difference between the frame pointer
and the stack pointer values immediately after the function prologue.
#define EXIT_IGNORE_STACK \
(get_frame_size () != 0 \
- || current_function_calls_alloca || crtl->outgoing_args_size)
+ || cfun->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.\
(use (reg:SI 2))]
"!TARGET_NO_SPACE_REGS
&& !TARGET_PA_20
- && flag_pic && current_function_calls_eh_return"
+ && flag_pic && crtl->calls_eh_return"
"ldsid (%%sr0,%%r2),%%r1\;mtsp %%r1,%%sr0\;be%* 0(%%sr0,%%r2)"
[(set_attr "type" "branch")
(set_attr "length" "12")])
using space registers. */
if (!TARGET_NO_SPACE_REGS
&& !TARGET_PA_20
- && flag_pic && current_function_calls_eh_return)
+ && flag_pic && crtl->calls_eh_return)
x = gen_return_external_pic ();
else
x = gen_return_internal ();
&& !df_regs_ever_live_p (RS6000_PIC_OFFSET_TABLE_REGNUM))
df_set_regs_ever_live (RS6000_PIC_OFFSET_TABLE_REGNUM, true);
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return pic_offset_table_rtx;
}
#if TARGET_MACHO
if (flag_pic
- && current_function_uses_pic_offset_table
+ && crtl->uses_pic_offset_table
&& first_reg > RS6000_PIC_OFFSET_TABLE_REGNUM)
return RS6000_PIC_OFFSET_TABLE_REGNUM;
#endif
/* On Darwin, the unwind routines are compiled without
TARGET_ALTIVEC, and use save_world to save/restore the
altivec registers when necessary. */
- if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return
+ if (DEFAULT_ABI == ABI_DARWIN && crtl->calls_eh_return
&& ! TARGET_ALTIVEC)
return FIRST_ALTIVEC_REGNO + 20;
/* On Darwin, the unwind routines are compiled without
TARGET_ALTIVEC, and use save_world to save/restore the
call-saved altivec registers when necessary. */
- if (DEFAULT_ABI == ABI_DARWIN && current_function_calls_eh_return
+ if (DEFAULT_ABI == ABI_DARWIN && crtl->calls_eh_return
&& ! TARGET_ALTIVEC)
mask |= 0xFFF;
info_ptr->world_save_p
= (WORLD_SAVE_P (info_ptr)
&& DEFAULT_ABI == ABI_DARWIN
- && ! (current_function_calls_setjmp && flag_exceptions)
+ && ! (cfun->calls_setjmp && flag_exceptions)
&& info_ptr->first_fp_reg_save == FIRST_SAVED_FP_REGNO
&& info_ptr->first_gp_reg_save == FIRST_SAVED_GP_REGNO
&& info_ptr->first_altivec_reg_save == FIRST_SAVED_ALTIVEC_REGNO
if (((TARGET_TOC && TARGET_MINIMAL_TOC)
|| (flag_pic == 1 && DEFAULT_ABI == ABI_V4)
|| (flag_pic && DEFAULT_ABI == ABI_DARWIN))
- && current_function_uses_const_pool
+ && crtl->uses_const_pool
&& info_ptr->first_gp_reg_save > RS6000_PIC_OFFSET_TABLE_REGNUM)
first_gp = RS6000_PIC_OFFSET_TABLE_REGNUM;
else
/* Determine if we need to save the link register. */
if ((DEFAULT_ABI == ABI_AIX
- && current_function_profile
+ && crtl->profile
&& !TARGET_PROFILE_KERNEL)
#ifdef TARGET_RELOCATABLE
|| (TARGET_RELOCATABLE && (get_pool_size () != 0))
#endif
|| (info_ptr->first_fp_reg_save != 64
&& !FP_SAVE_INLINE (info_ptr->first_fp_reg_save))
- || (DEFAULT_ABI == ABI_V4 && current_function_calls_alloca)
+ || (DEFAULT_ABI == ABI_V4 && cfun->calls_alloca)
|| info_ptr->calls_p
|| rs6000_ra_ever_killed ())
{
/* If the current function calls __builtin_eh_return, then we need
to allocate stack space for registers that will hold data for
the exception handler. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM; ++i)
/* Functions that save and restore all the call-saved registers will
need to save/restore the registers in 64-bits. */
- if (current_function_calls_eh_return
- || current_function_calls_setjmp
- || current_function_has_nonlocal_goto)
+ if (crtl->calls_eh_return
+ || cfun->calls_setjmp
+ || crtl->has_nonlocal_goto)
return true;
insns = get_insns ();
rtx reg;
rtx insn;
- if (current_function_is_thunk)
+ if (crtl->is_thunk)
return 0;
/* regs_ever_live has LR marked as used if any sibcalls are present,
rtx tmp;
if (frame_pointer_needed
- || current_function_calls_alloca
+ || cfun->calls_alloca
|| info->total_size > 32767)
{
tmp = gen_frame_mem (Pmode, frame_rtx);
return;
}
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
if (REG_P (stack_limit_rtx)
&& REGNO (stack_limit_rtx) > 1
&& no_global_regs_above (info->first_gp_reg_save));
saving_FPRs_inline = (info->first_fp_reg_save == 64
|| FP_SAVE_INLINE (info->first_fp_reg_save)
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
|| cfun->machine->ra_need_lr);
/* For V.4, update stack before we do any saving and set back pointer. */
if (! WORLD_SAVE_P (info)
&& info->push_p
&& (DEFAULT_ABI == ABI_V4
- || current_function_calls_eh_return))
+ || crtl->calls_eh_return))
{
if (info->total_size < 32767)
sp_offset = info->total_size;
&& info->cr_save_offset == 4
&& info->push_p
&& info->lr_save_p
- && (!current_function_calls_eh_return
+ && (!crtl->calls_eh_return
|| info->ehrd_offset == -432)
&& info->vrsave_save_offset == -224
&& info->altivec_save_offset == -416);
/* ??? There's no need to emit actual instructions here, but it's the
easiest way to get the frame unwind information emitted. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i, regno;
/* Update stack and set back pointer unless this is V.4,
for which it was done previously. */
if (!WORLD_SAVE_P (info) && info->push_p
- && !(DEFAULT_ABI == ABI_V4 || current_function_calls_eh_return))
+ && !(DEFAULT_ABI == ABI_V4 || crtl->calls_eh_return))
{
if (info->total_size < 32767)
sp_offset = info->total_size;
#if TARGET_MACHO
if (DEFAULT_ABI == ABI_DARWIN
- && flag_pic && current_function_uses_pic_offset_table)
+ && flag_pic && crtl->uses_pic_offset_table)
{
rtx lr = gen_rtx_REG (Pmode, LR_REGNO);
rtx src = machopic_function_base_sym ();
&& info->first_gp_reg_save < 31
&& no_global_regs_above (info->first_gp_reg_save));
restoring_FPRs_inline = (sibcall
- || current_function_calls_eh_return
+ || crtl->calls_eh_return
|| info->first_fp_reg_save == 64
|| FP_SAVE_INLINE (info->first_fp_reg_save));
use_backchain_to_restore_sp = (frame_pointer_needed
- || current_function_calls_alloca
+ || cfun->calls_alloca
|| info->total_size > 32767);
using_mtcr_multiple = (rs6000_cpu == PROCESSOR_PPC601
|| rs6000_cpu == PROCESSOR_PPC603
+ LAST_ALTIVEC_REGNO + 1 - info->first_altivec_reg_save
+ 63 + 1 - info->first_fp_reg_save);
- strcpy (rname, ((current_function_calls_eh_return) ?
+ strcpy (rname, ((crtl->calls_eh_return) ?
"*eh_rest_world_r10" : "*rest_world"));
alloc_rname = ggc_strdup (rname);
}
else if (info->push_p
&& DEFAULT_ABI != ABI_V4
- && !current_function_calls_eh_return)
+ && !crtl->calls_eh_return)
{
emit_insn (TARGET_32BIT
? gen_addsi3 (sp_reg_rtx, sp_reg_rtx,
gen_rtx_REG (Pmode, 0));
/* Load exception handler data registers, if needed. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i, regno;
: gen_adddi3 (sp_reg_rtx, sp_reg_rtx,
GEN_INT (sp_offset)));
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
rtx sa = EH_RETURN_STACKADJ_RTX;
emit_insn (TARGET_32BIT
System V.4 Powerpc's (and the embedded ABI derived from it) use a
different traceback table. */
if (DEFAULT_ABI == ABI_AIX && ! flag_inhibit_size_directive
- && rs6000_traceback != traceback_none && !current_function_is_thunk)
+ && rs6000_traceback != traceback_none && !crtl->is_thunk)
{
const char *fname = NULL;
const char *language_string = lang_hooks.name;
int caller_addr_regno = LR_REGNO;
/* Be conservative and always set this, at least for now. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
#if TARGET_MACHO
/* For PIC code, set up a stub and collect the caller's address
from r0, which is where the prologue puts it. */
if (MACHOPIC_INDIRECT
- && current_function_uses_pic_offset_table)
+ && crtl->uses_pic_offset_table)
caller_addr_regno = 0;
#endif
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, mcount_name),
if (TARGET_RELOCATABLE
&& !TARGET_SECURE_PLT
- && (get_pool_size () != 0 || current_function_profile)
+ && (get_pool_size () != 0 || crtl->profile)
&& uses_TOC ())
{
char buf[256];
#define EPILOGUE_USES(REGNO) \
((reload_completed && (REGNO) == LR_REGNO) \
|| (TARGET_ALTIVEC && (REGNO) == VRSAVE_REGNO) \
- || (current_function_calls_eh_return \
+ || (crtl->calls_eh_return \
&& TARGET_AIX \
&& (REGNO) == 2))
emit_move_insn (chain, stack_bot);
/* Check stack bounds if necessary. */
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
rtx available;
available = expand_binop (Pmode, sub_optab,
may use the eh registers, but the code which sets these registers is not
contained in that function. Hence s390_regs_ever_clobbered is not able to
deal with this automatically. */
- if (current_function_calls_eh_return || cfun->machine->has_landing_pad_p)
+ if (crtl->calls_eh_return || cfun->machine->has_landing_pad_p)
for (i = 0; EH_RETURN_DATA_REGNO (i) != INVALID_REGNUM ; i++)
- if (current_function_calls_eh_return
+ if (crtl->calls_eh_return
|| (cfun->machine->has_landing_pad_p
&& df_regs_ever_live_p (EH_RETURN_DATA_REGNO (i))))
regs_ever_clobbered[EH_RETURN_DATA_REGNO (i)] = 1;
This flag is also set for the unwinding code in libgcc.
See expand_builtin_unwind_init. For regs_ever_live this is done by
reload. */
- if (current_function_has_nonlocal_label)
+ if (cfun->has_nonlocal_label)
for (i = 0; i < 16; i++)
if (!call_really_used_regs[i])
regs_ever_clobbered[i] = 1;
|| TARGET_TPF_PROFILING
|| cfun->machine->split_branches_pending_p
|| cfun_frame_layout.save_return_addr_p
- || current_function_calls_eh_return
- || current_function_stdarg);
+ || crtl->calls_eh_return
+ || cfun->stdarg);
clobbered_regs[STACK_POINTER_REGNUM]
|= (!current_function_is_leaf
|| TARGET_TPF_PROFILING
|| cfun_save_high_fprs_p
|| get_frame_size () > 0
- || current_function_calls_alloca
- || current_function_stdarg);
+ || cfun->calls_alloca
+ || cfun->stdarg);
for (i = 6; i < 16; i++)
if (df_regs_ever_live_p (i) || clobbered_regs[i])
}
}
- if (current_function_stdarg)
+ if (cfun->stdarg)
{
/* Varargs functions need to save gprs 2 to 6. */
if (cfun->va_list_gpr_size
&& !TARGET_TPF_PROFILING
&& cfun_frame_layout.frame_size == 0
&& !cfun_save_high_fprs_p
- && !current_function_calls_alloca
- && !current_function_stdarg)
+ && !cfun->calls_alloca
+ && !cfun->stdarg)
return;
if (!TARGET_PACKED_STACK)
/* Try to predict whether we'll need the base register. */
base_used = cfun->machine->split_branches_pending_p
- || current_function_uses_const_pool
+ || crtl->uses_const_pool
|| (!DISP_IN_RANGE (frame_size)
&& !CONST_OK_FOR_K (frame_size));
/* Make sure we actually saved the return address. */
if (from == RETURN_ADDRESS_POINTER_REGNUM)
- if (!current_function_calls_eh_return
- && !current_function_stdarg
+ if (!crtl->calls_eh_return
+ && !cfun->stdarg
&& !cfun_frame_layout.save_return_addr_p)
return false;
gen_rtx_REG (Pmode, first),
GEN_INT (last - first + 1));
- if (first <= 6 && current_function_stdarg)
+ if (first <= 6 && cfun->stdarg)
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
rtx mem = XEXP (XVECEXP (PATTERN (insn), 0, i), 0);
Zero means the frame pointer need not be set up (and parms
may be accessed via the stack pointer) in functions that seem suitable.
This is computed in `reload', in reload1.c. */
-#define FRAME_POINTER_REQUIRED current_function_calls_alloca
+#define FRAME_POINTER_REQUIRED cfun->calls_alloca
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
if (f->var_size == 0 && current_function_is_leaf)
f->args_size = f->cprestore_size = 0;
- if (f->args_size == 0 && current_function_calls_alloca)
+ if (f->args_size == 0 && cfun->calls_alloca)
f->args_size = UNITS_PER_WORD;
f->total_size = f->var_size + f->args_size + f->cprestore_size;
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0;; ++i)
rtx mem = gen_rtx_MEM (SImode, gen_rtx_PRE_DEC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, rd);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
if (cnt == 1)
rtx mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, rd);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
if (cnt == 1)
if (base != stack_pointer_rtx)
emit_move_insn (stack_pointer_rtx, base);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
if (f->var_size == 0 && current_function_is_leaf)
f->args_size = f->cprestore_size = 0;
- if (f->args_size == 0 && current_function_calls_alloca)
+ if (f->args_size == 0 && cfun->calls_alloca)
f->args_size = UNITS_PER_WORD;
f->total_size = f->var_size + f->args_size + f->cprestore_size;
}
}
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
unsigned int i;
for (i = 0;; ++i)
rtx mem = gen_rtx_MEM (SImode,
gen_rtx_PRE_DEC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, regno);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
EMIT_PL (emit_insn (gen_pushsi_score7 (mem, reg)));
}
if (base != stack_pointer_rtx)
emit_move_insn (stack_pointer_rtx, base);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (gen_add3_insn (stack_pointer_rtx,
stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
gen_rtx_POST_INC (SImode, stack_pointer_rtx));
rtx reg = gen_rtx_REG (SImode, regno);
- if (!current_function_calls_eh_return)
+ if (!crtl->calls_eh_return)
MEM_READONLY_P (mem) = 1;
emit_insn (gen_popsi_score7 (reg, mem));
}
for (i = 0; i < nreg; i++)
CLEAR_HARD_REG_BIT (temps, FIRST_RET_REG + i);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
CLEAR_HARD_REG_BIT (temps, EH_RETURN_STACKADJ_REGNO);
for (i = 0; i <= 3; i++)
if (TARGET_SHCOMPACT
&& ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
- || current_function_saves_all_registers))
+ || crtl->saves_all_registers))
pr_live = 1;
has_call = TARGET_SHMEDIA ? ! leaf_function_p () : pr_live;
for (count = 0, reg = FIRST_PSEUDO_REGISTER; reg-- != 0; )
|| (df_regs_ever_live_p (reg)
&& (!call_really_used_regs[reg]
|| (trapa_handler && reg == FPSCR_REG && TARGET_FPU_ANY)))
- || (current_function_calls_eh_return
+ || (crtl->calls_eh_return
&& (reg == EH_RETURN_DATA_REGNO (0)
|| reg == EH_RETURN_DATA_REGNO (1)
|| reg == EH_RETURN_DATA_REGNO (2)
&& ! FUNCTION_ARG_REGNO_P (i)
&& i != FIRST_RET_REG
&& ! (cfun->static_chain_decl != NULL && i == STATIC_CHAIN_REGNUM)
- && ! (current_function_calls_eh_return
+ && ! (crtl->calls_eh_return
&& (i == EH_RETURN_STACKADJ_REGNO
|| ((unsigned) i >= EH_RETURN_DATA_REGNO (0)
&& (unsigned) i <= EH_RETURN_DATA_REGNO (3)))))
}
/* Emit the code for SETUP_VARARGS. */
- if (current_function_stdarg)
+ if (cfun->stdarg)
{
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl))
{
+ crtl->args.info.stack_regs * 8,
stack_pointer_rtx, e, NULL);
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
emit_insn (GEN_ADD3 (stack_pointer_rtx, stack_pointer_rtx,
EH_RETURN_STACKADJ_RTX));
int *pretend_arg_size,
int second_time ATTRIBUTE_UNUSED)
{
- gcc_assert (current_function_stdarg);
+ gcc_assert (cfun->stdarg);
if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl))
{
int named_parm_regs, anon_parm_regs;
&& ! (TARGET_SHCOMPACT
&& ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
- || current_function_saves_all_registers)))
+ || crtl->saves_all_registers)))
x = hard_reg;
else
x = gen_frame_mem (Pmode, return_address_pointer_rtx);
if (TARGET_SHCOMPACT
&& ((crtl->args.info.call_cookie
& ~ CALL_COOKIE_RET_TRAMP (1))
- || current_function_saves_all_registers))
+ || crtl->saves_all_registers))
return gen_frame_mem (SImode, return_address_pointer_rtx);
/* If we haven't finished rtl generation, there might be a nonlocal label
#define DEFAULT_PCC_STRUCT_RETURN 0
#define SHMEDIA_REGS_STACK_ADJUST() \
- (TARGET_SHCOMPACT && current_function_saves_all_registers \
+ (TARGET_SHCOMPACT && crtl->saves_all_registers \
? (8 * (/* r28-r35 */ 8 + /* r44-r59 */ 16 + /* tr5-tr7 */ 3) \
+ (TARGET_FPU_ANY ? 4 * (/* fr36 - fr63 */ 28) : 0)) \
: 0)
[(set (match_dup 0) (match_dup 1))]
"
{
- if (TARGET_SHCOMPACT && current_function_saves_all_registers)
+ if (TARGET_SHCOMPACT && crtl->saves_all_registers)
operands[1] = gen_frame_mem (SImode, return_address_pointer_rtx);
}")
/* If the function uses __builtin_eh_return, the eh_return machinery
occupies the delay slot. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
return 0;
/* In the case of a true leaf function, anything can go into the slot. */
rtx temp;
if (flag_pic)
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return pic_offset_table_rtx;
}
pic_ref = gen_const_mem (Pmode,
gen_rtx_PLUS (Pmode,
pic_offset_table_rtx, address));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
insn = emit_move_insn (reg, pic_ref);
/* Put a REG_EQUAL note on this insn, so that it can be optimized
by loop. */
/* ??? Why do we do this? */
/* Now movsi_pic_label_ref uses it, but we ought to be checking that
the register is live instead, in case it is eliminated. */
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
return orig;
}
: !SYMBOL_REF_LOCAL_P (addr)))
{
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), pic_offset_table_rtx);
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}
}
\f
emit_save_or_restore_regs (SORR_SAVE);
/* Load the PIC register if needed. */
- if (flag_pic && current_function_uses_pic_offset_table)
+ if (flag_pic && crtl->uses_pic_offset_table)
load_pic_register (false);
}
semantics of restore/return. We simply output the jump to the
return address and the insn in the delay slot (if any). */
- gcc_assert (! current_function_calls_eh_return);
+ gcc_assert (! crtl->calls_eh_return);
return "jmp\t%%o7+%)%#";
}
combined with the 'restore' instruction or put in the delay slot of
the 'return' instruction. */
- if (current_function_calls_eh_return)
+ if (crtl->calls_eh_return)
{
/* If the function uses __builtin_eh_return, the eh_return
machinery occupies the delay slot. */
The call emitted is the same when sparc_std_struct_return is
present. */
if (! TARGET_ARCH64
- && current_function_returns_struct
+ && cfun->returns_struct
&& ! sparc_std_struct_return
&& (TREE_CODE (DECL_SIZE (DECL_RESULT (current_function_decl)))
== INTEGER_CST)
{
return (decl
&& flag_delayed_branch
- && (TARGET_ARCH64 || ! current_function_returns_struct)
+ && (TARGET_ARCH64 || ! cfun->returns_struct)
&& !(TARGET_VXWORKS_RTP
&& flag_pic
&& !targetm.binds_local_p (decl)));
#define EXIT_IGNORE_STACK \
(get_frame_size () != 0 \
- || current_function_calls_alloca || crtl->outgoing_args_size)
+ || cfun->calls_alloca || crtl->outgoing_args_size)
/* Define registers used by the epilogue and return instruction. */
#define EPILOGUE_USES(REGNO) ((REGNO) == 31 \
- || (current_function_calls_eh_return && (REGNO) == 1))
+ || (crtl->calls_eh_return && (REGNO) == 1))
\f
/* Length in units of the trampoline for entering a nested function. */
/* This is the offset of the return address to the true next instruction to be
executed for the current function. */
#define RETURN_ADDR_OFFSET \
- (8 + 4 * (! TARGET_ARCH64 && current_function_returns_struct))
+ (8 + 4 * (! TARGET_ARCH64 && cfun->returns_struct))
/* The current return address is in %i7. The return address of anything
farther back is in the register window save area at [%fp+60]. */
(symbol_ref "flag_pic != 0"))
(define_attr "calls_alloca" "false,true"
- (symbol_ref "current_function_calls_alloca != 0"))
+ (symbol_ref "cfun->calls_alloca != 0"))
(define_attr "calls_eh_return" "false,true"
- (symbol_ref "current_function_calls_eh_return !=0 "))
+ (symbol_ref "crtl->calls_eh_return !=0 "))
(define_attr "leaf_function" "false,true"
(symbol_ref "current_function_uses_only_leaf_regs != 0"))
(minus:SI (match_dup 5) (match_dup 4)))]
"flag_pic"
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
operands[2] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
if (!can_create_pseudo_p ())
{
(minus:DI (match_dup 5) (match_dup 4)))]
"TARGET_ARCH64 && flag_pic"
{
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
operands[2] = gen_rtx_SYMBOL_REF (Pmode, "_GLOBAL_OFFSET_TABLE_");
if (!can_create_pseudo_p ())
{
[(unspec_volatile [(const_int 0)] UNSPECV_SETJMP)]
""
{
- if (! current_function_calls_alloca)
+ if (! cfun->calls_alloca)
return "";
if (! TARGET_V9)
return "\tta\t3\n";
{
rtx pic_reg = get_pic_reg ();
emit_insn (gen_addsi3 (ops[0], ops[0], pic_reg));
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
}
return flag_pic || c == IC_IL2s;
}
return 1;
if (flag_pic
&& regno == PIC_OFFSET_TABLE_REGNUM
- && (!saving || current_function_uses_pic_offset_table)
+ && (!saving || crtl->uses_pic_offset_table)
&& (!saving
|| !current_function_is_leaf || df_regs_ever_live_p (LAST_ARG_REGNUM)))
return 1;
emit_note (NOTE_INSN_DELETED);
if (flag_pic && optimize == 0)
- current_function_uses_pic_offset_table = 1;
+ crtl->uses_pic_offset_table = 1;
if (spu_naked_function_p (current_function_decl))
return;
+ crtl->args.pretend_args_size;
if (!current_function_is_leaf
- || current_function_calls_alloca || total_size > 0)
+ || cfun->calls_alloca || total_size > 0)
total_size += STACK_POINTER_OFFSET;
/* Save this first because code after this might use the link
}
}
- if (flag_pic && current_function_uses_pic_offset_table)
+ if (flag_pic && crtl->uses_pic_offset_table)
{
rtx pic_reg = get_pic_reg ();
insn = emit_insn (gen_load_pic_offset (pic_reg, scratch_reg_0));
+ crtl->args.pretend_args_size;
if (!current_function_is_leaf
- || current_function_calls_alloca || total_size > 0)
+ || cfun->calls_alloca || total_size > 0)
total_size += STACK_POINTER_OFFSET;
if (total_size > 0)
{
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
frame_emit_load (STACK_POINTER_REGNUM, sp_reg, 0);
else
frame_emit_add_imm (sp_reg, sp_reg, total_size, scratch_reg_0);
if (REG_NEEDS_SAVE (regno, ifun))
layout.register_save_size += UNITS_PER_WORD;
- if (current_function_stdarg)
+ if (cfun->stdarg)
layout.stdarg_save_size = NUM_ARGUMENT_REGISTERS * UNITS_PER_WORD;
else
layout.stdarg_save_size = 0;
long reg_saved = 0;
/* Count the return pointer if we need to save it. */
- if (current_function_profile && !call_p)
+ if (crtl->profile && !call_p)
{
df_set_regs_ever_live (LINK_POINTER_REGNUM, true);
call_p = 1;
#include "xtensa-config.h"
/* Standard GCC variables that we reference. */
-extern int current_function_calls_alloca;
+extern int cfun->calls_alloca;
extern int optimize;
/* External variables defined in xtensa.c. */
+2008-04-25 Jan Hubicka <jh@suse.cz>
+
+ * typeck.c (check_return_expr): Update.
+ * decl.c (start_preparsed_function): Update.
+ * method.c (use_thunk): Update.
+
2008-04-24 Jakub Jelinek <jakub@redhat.com>
PR c++/35758
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
/* Start the statement-tree, start the tree now. */
DECL_SAVED_TREE (decl1) = push_stmt_list ();
BLOCK_VARS (fn_block) = a;
DECL_INITIAL (thunk_fndecl) = fn_block;
init_function_start (thunk_fndecl);
- current_function_is_thunk = 1;
+ crtl->is_thunk = 1;
assemble_start_function (thunk_fndecl, fnname);
targetm.asm_out.output_mi_thunk (asm_out_file, thunk_fndecl,
if (retval == error_mark_node)
return retval;
/* We can't initialize a register from a AGGR_INIT_EXPR. */
- else if (! current_function_returns_struct
+ else if (! cfun->returns_struct
&& TREE_CODE (retval) == TARGET_EXPR
&& TREE_CODE (TREE_OPERAND (retval, 1)) == AGGR_INIT_EXPR)
retval = build2 (COMPOUND_EXPR, TREE_TYPE (retval), retval,
#ifdef EH_RETURN_DATA_REGNO
/* Mark the registers that will contain data for the handler. */
- if (reload_completed && current_function_calls_eh_return)
+ if (reload_completed && crtl->calls_eh_return)
for (i = 0; ; ++i)
{
unsigned regno = EH_RETURN_DATA_REGNO (i);
#ifdef EH_RETURN_STACKADJ_RTX
if ((!HAVE_epilogue || ! epilogue_completed)
- && current_function_calls_eh_return)
+ && crtl->calls_eh_return)
{
rtx tmp = EH_RETURN_STACKADJ_RTX;
if (tmp && REG_P (tmp))
#ifdef EH_RETURN_HANDLER_RTX
if ((!HAVE_epilogue || ! epilogue_completed)
- && current_function_calls_eh_return)
+ && crtl->calls_eh_return)
{
rtx tmp = EH_RETURN_HANDLER_RTX;
if (tmp && REG_P (tmp))
clear_pending_stack_adjust (void)
{
if (optimize > 0
- && (! flag_omit_frame_pointer || current_function_calls_alloca)
+ && (! flag_omit_frame_pointer || cfun->calls_alloca)
&& EXIT_IGNORE_STACK
&& ! (DECL_INLINE (current_function_decl) && ! flag_no_inline))
discard_pending_stack_adjust ();
static alloc_pool clear_alias_mode_pool;
-/* This is true except if current_function_stdarg -- i.e. we cannot do
+/* This is true except if cfun->stdarg -- i.e. we cannot do
this for vararg functions because they play games with the frame. */
static bool stores_off_frame_dead_at_return;
bb_table = XCNEWVEC (bb_info_t, last_basic_block);
rtx_group_next_id = 0;
- stores_off_frame_dead_at_return = !current_function_stdarg;
+ stores_off_frame_dead_at_return = !cfun->stdarg;
init_alias_analysis ();
&& (EDGE_COUNT (bb->succs) == 0
|| (single_succ_p (bb)
&& single_succ (bb) == EXIT_BLOCK_PTR
- && ! current_function_calls_eh_return)))
+ && ! crtl->calls_eh_return)))
{
insn_info_t i_ptr = active_local_stores;
while (i_ptr)
fde->dw_fde_cfi = NULL;
fde->funcdef_number = current_function_funcdef_no;
fde->nothrow = TREE_NOTHROW (current_function_decl);
- fde->uses_eh_lsda = cfun->uses_eh_lsda;
- fde->all_throwers_are_sibcalls = cfun->all_throwers_are_sibcalls;
+ fde->uses_eh_lsda = crtl->uses_eh_lsda;
+ fde->all_throwers_are_sibcalls = crtl->all_throwers_are_sibcalls;
args_size = old_args_size = 0;
{
rtx mem = gen_rtx_MEM (mode, addr);
MEM_NOTRAP_P (mem) = 1;
- if (!current_function_calls_alloca)
+ if (!cfun->calls_alloca)
set_mem_alias_set (mem, get_frame_alias_set ());
return mem;
}
r->landing_pad = dispatch_label;
lp_info[i].action_index = collect_one_action_chain (ar_hash, r);
if (lp_info[i].action_index != -1)
- cfun->uses_eh_lsda = 1;
+ crtl->uses_eh_lsda = 1;
}
htab_delete (ar_hash);
emit_move_insn (mem, eh_personality_libfunc);
mem = adjust_address (fc, Pmode, sjlj_fc_lsda_ofs);
- if (cfun->uses_eh_lsda)
+ if (crtl->uses_eh_lsda)
{
char buf[20];
rtx sym;
return can_throw_external_1 (INTVAL (XEXP (note, 0)), false);
}
-/* Set TREE_NOTHROW and cfun->all_throwers_are_sibcalls. */
+/* Set TREE_NOTHROW and crtl->all_throwers_are_sibcalls. */
unsigned int
set_nothrow_function_flags (void)
TREE_NOTHROW (current_function_decl) = 1;
- /* Assume cfun->all_throwers_are_sibcalls until we encounter
+ /* Assume crtl->all_throwers_are_sibcalls until we encounter
something that can throw an exception. We specifically exempt
CALL_INSNs that are SIBLING_CALL_P, as these are really jumps,
and can't throw. Most CALL_INSNs are not SIBLING_CALL_P, so this
is optimistic. */
- cfun->all_throwers_are_sibcalls = 1;
+ crtl->all_throwers_are_sibcalls = 1;
if (! flag_exceptions)
return 0;
if (!CALL_P (insn) || !SIBLING_CALL_P (insn))
{
- cfun->all_throwers_are_sibcalls = 0;
+ crtl->all_throwers_are_sibcalls = 0;
return 0;
}
}
if (!CALL_P (insn) || !SIBLING_CALL_P (insn))
{
- cfun->all_throwers_are_sibcalls = 0;
+ crtl->all_throwers_are_sibcalls = 0;
return 0;
}
}
{
/* Set this so all the registers get saved in our frame; we need to be
able to copy the saved values for any registers from frames we unwind. */
- current_function_saves_all_registers = 1;
+ crtl->saves_all_registers = 1;
#ifdef SETUP_FRAME_ADDRESSES
SETUP_FRAME_ADDRESSES ();
if (! crtl->eh.ehr_label)
return;
- current_function_calls_eh_return = 1;
+ crtl->calls_eh_return = 1;
#ifdef EH_RETURN_STACKADJ_RTX
emit_move_insn (EH_RETURN_STACKADJ_RTX, const0_rtx);
/* Existence of catch handlers, or must-not-throw regions
implies that an lsda is needed (even if empty). */
if (this_action != -1)
- cfun->uses_eh_lsda = 1;
+ crtl->uses_eh_lsda = 1;
/* Delay creation of region notes for no-action regions
until we're sure that an lsda will be required. */
int tt_format_size = 0;
/* Not all functions need anything. */
- if (! cfun->uses_eh_lsda)
+ if (! crtl->uses_eh_lsda)
return;
if (eh_personality_libfunc)
return virtual_stack_dynamic_rtx;
/* Otherwise, show we're calling alloca or equivalent. */
- current_function_calls_alloca = 1;
+ cfun->calls_alloca = 1;
/* Ensure the size is in the proper mode. */
if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
would use reg notes to store the "optimized" size and fix things
up later. These days we know this information before we ever
start building RTL so the reg notes are unnecessary. */
- if (!current_function_calls_setjmp)
+ if (!cfun->calls_setjmp)
{
int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
#endif
/* Check stack bounds if necessary. */
- if (current_function_limit_stack)
+ if (crtl->limit_stack)
{
rtx available;
rtx space_available = gen_label_rtx ();
the place the value is being stored, use a safe function when copying
a value through a pointer into a structure value return block. */
if (TREE_CODE (to) == RESULT_DECL && TREE_CODE (from) == INDIRECT_REF
- && current_function_returns_struct
- && !current_function_returns_pcc_struct)
+ && cfun->returns_struct
+ && !cfun->returns_pcc_struct)
{
rtx from_rtx, size;
/* The Sun386i and perhaps other machines don't work right
if the profiling code comes after the prologue. */
#ifdef PROFILE_BEFORE_PROLOGUE
- if (current_function_profile)
+ if (crtl->profile)
profile_function (file);
#endif /* PROFILE_BEFORE_PROLOGUE */
profile_after_prologue (FILE *file ATTRIBUTE_UNUSED)
{
#ifndef PROFILE_BEFORE_PROLOGUE
- if (current_function_profile)
+ if (crtl->profile)
profile_function (file);
#endif /* not PROFILE_BEFORE_PROLOGUE */
}
# define NO_PROFILE_COUNTERS 0
#endif
#if defined(ASM_OUTPUT_REG_PUSH)
- int sval = current_function_returns_struct;
+ int sval = cfun->returns_struct;
rtx svrtx = targetm.calls.struct_value_rtx (TREE_TYPE (current_function_decl), 1);
#if defined(STATIC_CHAIN_INCOMING_REGNUM) || defined(STATIC_CHAIN_REGNUM)
int cxt = cfun->static_chain_decl != NULL;
rtx insn;
rtx link;
- if (current_function_profile || profile_arc_flag)
+ if (crtl->profile || profile_arc_flag)
return 0;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
&& ! permitted_reg_in_leaf_functions[i])
return 0;
- if (current_function_uses_pic_offset_table
+ if (crtl->uses_pic_offset_table
&& pic_offset_table_rtx != 0
&& REG_P (pic_offset_table_rtx)
&& ! permitted_reg_in_leaf_functions[REGNO (pic_offset_table_rtx)])
+2008-04-25 Jan Hubicka <jh@suse.cz>
+
+ * trans-decl.c (trans_function_start): Update.
+
2008-04-25 Tobias Burnus <burnus@net-b.de>
Daniel Franke <franke.daniel@gmail.com>
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
/* function.c requires a push at the start of the function. */
pushlevel (0);
/* If struct value address is treated as the first argument, make it so. */
if (aggregate_value_p (DECL_RESULT (fndecl), fndecl)
- && ! current_function_returns_pcc_struct
+ && ! cfun->returns_pcc_struct
&& targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0)
{
tree type = build_pointer_type (TREE_TYPE (fntype));
memset (data, 0, sizeof (*data));
/* NAMED_ARG is a mis-nomer. We really mean 'non-varadic'. */
- if (!current_function_stdarg)
+ if (!cfun->stdarg)
data->named_arg = 1; /* No varadic parms. */
else if (TREE_CHAIN (parm))
data->named_arg = 1; /* Not the last non-varadic parm. */
continue;
}
- if (current_function_stdarg && !TREE_CHAIN (parm))
+ if (cfun->stdarg && !TREE_CHAIN (parm))
assign_parms_setup_varargs (&all, &data, false);
/* Find out where the parameter arrives in this function. */
if (!abstract_p && aggregate_value_p (result, fndecl))
{
#ifdef PCC_STATIC_STRUCT_RETURN
- current_function_returns_pcc_struct = 1;
+ cfun->returns_pcc_struct = 1;
#endif
- current_function_returns_struct = 1;
+ cfun->returns_struct = 1;
}
- current_function_stdarg
+ cfun->stdarg
= (fntype
&& TYPE_ARG_TYPES (fntype) != 0
&& (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype)))
valid operands of arithmetic insns. */
init_recog_no_volatile ();
- current_function_profile
+ crtl->profile
= (profile_flag
&& ! DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT (subr));
- current_function_limit_stack
+ crtl->limit_stack
= (stack_limit_rtx != NULL_RTX && ! DECL_NO_LIMIT_STACK (subr));
/* Make the label for return statements to jump to. Do not special
rtx value_address = 0;
#ifdef PCC_STATIC_STRUCT_RETURN
- if (current_function_returns_pcc_struct)
+ if (cfun->returns_pcc_struct)
{
int size = int_size_in_bytes (TREE_TYPE (DECL_RESULT (subr)));
value_address = assemble_static_space (size);
parm_birth_insn = get_last_insn ();
- if (current_function_profile)
+ if (crtl->profile)
{
#ifdef PROFILE_HOOK
PROFILE_HOOK (current_function_funcdef_no);
/* If arg_pointer_save_area was referenced only from a nested
function, we will not have initialized it yet. Do that now. */
- if (arg_pointer_save_area && ! cfun->arg_pointer_save_area_init)
+ if (arg_pointer_save_area && ! crtl->arg_pointer_save_area_init)
get_arg_pointer_save_area ();
/* If we are doing stack checking and this function makes calls,
If returning a structure PCC style,
the caller also depends on this value.
- And current_function_returns_pcc_struct is not necessarily set. */
- if (current_function_returns_struct
- || current_function_returns_pcc_struct)
+ And cfun->returns_pcc_struct is not necessarily set. */
+ if (cfun->returns_struct
+ || cfun->returns_pcc_struct)
{
rtx value_address = DECL_RTL (DECL_RESULT (current_function_decl));
tree type = TREE_TYPE (DECL_RESULT (current_function_decl));
an accurate stack pointer to exit the function,
insert some code to save and restore the stack pointer. */
if (! EXIT_IGNORE_STACK
- && current_function_calls_alloca)
+ && cfun->calls_alloca)
{
rtx tem = 0;
arg_pointer_save_area = ret;
}
- if (! cfun->arg_pointer_save_area_init)
+ if (! crtl->arg_pointer_save_area_init)
{
rtx seq;
/* Insert an explicit USE for the frame pointer
if the profiling is on and the frame pointer is required. */
- if (current_function_profile && frame_pointer_needed)
+ if (crtl->profile && frame_pointer_needed)
emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
/* Retain a map of the prologue insns. */
/* Ensure that instructions are not moved into the prologue when
profiling is on. The call to the profiling routine can be
emitted within the live range of a call-clobbered register. */
- if (current_function_profile)
+ if (crtl->profile)
emit_insn (gen_blockage ());
#endif
rtx insn, pat, *p_sets;
int noutputs;
- if (!cfun->has_asm_statement)
+ if (!crtl->has_asm_statement)
return 0;
df_set_flags (DF_DEFER_INSN_RESCAN);
/* If some insns can be deferred to the delay slots of the epilogue, the
delay list for them is recorded here. */
rtx epilogue_delay_list;
+
+ /* Nonzero if function being compiled called builtin_return_addr or
+ builtin_frame_address with nonzero count. */
+ bool accesses_prior_frames;
+
+ /* Nonzero if the function calls __builtin_eh_return. */
+ bool calls_eh_return;
+
+ /* Nonzero if function saves all registers, e.g. if it has a nonlocal
+ label that can reach the exit block via non-exceptional paths. */
+ bool saves_all_registers;
+
+ /* Nonzero if function being compiled has nonlocal gotos to parent
+ function. */
+ bool has_nonlocal_goto;
+
+ /* Nonzero if function being compiled has an asm statement. */
+ bool has_asm_statement;
+
+ /* Nonzero if the current function is a thunk, i.e., a lightweight
+ function implemented by the output_mi_thunk hook) that just
+ adjusts one of its arguments and forwards to another
+ function. */
+ bool is_thunk;
+
+ /* This bit is used by the exception handling logic. It is set if all
+ calls (if any) are sibling calls. Such functions do not have to
+ have EH tables generated, as they cannot throw. A call to such a
+ function, however, should be treated as throwing if any of its callees
+ can throw. */
+ bool all_throwers_are_sibcalls;
+
+ /* Nonzero if stack limit checking should be enabled in the current
+ function. */
+ bool limit_stack;
+
+ /* Nonzero if profiling code should be generated. */
+ bool profile;
+
+ /* Nonzero if the current function uses the constant pool. */
+ bool uses_const_pool;
+
+ /* Nonzero if the current function uses pic_offset_table_rtx. */
+ bool uses_pic_offset_table;
+
+ /* Nonzero if the current function needs an lsda for exception handling. */
+ bool uses_eh_lsda;
+
+ /* Set when the tail call has been produced. */
+ bool tail_call_emit;
+
+ /* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
+ bool arg_pointer_save_area_init;
};
#define return_label (crtl->x_return_label)
either as a subroutine or builtin. */
unsigned int calls_alloca : 1;
- /* Nonzero if function being compiled called builtin_return_addr or
- builtin_frame_address with nonzero count. */
- unsigned int accesses_prior_frames : 1;
-
- /* Nonzero if the function calls __builtin_eh_return. */
- unsigned int calls_eh_return : 1;
-
-
/* Nonzero if function being compiled receives nonlocal gotos
from nested functions. */
unsigned int has_nonlocal_label : 1;
- /* Nonzero if function saves all registers, e.g. if it has a nonlocal
- label that can reach the exit block via non-exceptional paths. */
- unsigned int saves_all_registers : 1;
-
- /* Nonzero if function being compiled has nonlocal gotos to parent
- function. */
- unsigned int has_nonlocal_goto : 1;
-
- /* Nonzero if function being compiled has an asm statement. */
- unsigned int has_asm_statement : 1;
-
- /* Nonzero if the current function is a thunk, i.e., a lightweight
- function implemented by the output_mi_thunk hook) that just
- adjusts one of its arguments and forwards to another
- function. */
- unsigned int is_thunk : 1;
-
- /* This bit is used by the exception handling logic. It is set if all
- calls (if any) are sibling calls. Such functions do not have to
- have EH tables generated, as they cannot throw. A call to such a
- function, however, should be treated as throwing if any of its callees
- can throw. */
- unsigned int all_throwers_are_sibcalls : 1;
-
- /* Nonzero if profiling code should be generated. */
- unsigned int profile : 1;
-
- /* Nonzero if stack limit checking should be enabled in the current
- function. */
- unsigned int limit_stack : 1;
-
-
/* Nonzero if current function uses stdarg.h or equivalent. */
unsigned int stdarg : 1;
variable-sized type, then the size of the parameter is computed
when the function body is entered. However, some front-ends do
not desire this behavior. */
- unsigned int x_dont_save_pending_sizes_p : 1;
-
- /* Nonzero if the current function uses the constant pool. */
- unsigned int uses_const_pool : 1;
-
- /* Nonzero if the current function uses pic_offset_table_rtx. */
- unsigned int uses_pic_offset_table : 1;
-
- /* Nonzero if the current function needs an lsda for exception handling. */
- unsigned int uses_eh_lsda : 1;
-
- /* Nonzero if code to initialize arg_pointer_save_area has been emitted. */
- unsigned int arg_pointer_save_area_init : 1;
+ unsigned int dont_save_pending_sizes_p : 1;
unsigned int after_inlining : 1;
- /* Set when the call to function itself has been emit. */
- unsigned int recursive_call_emit : 1;
-
-
- /* Set when the tail call has been produced. */
- unsigned int tail_call_emit : 1;
-
- /* FIXME tuples: This bit is temporarily here to mark when a
- function has been gimplified, so we can make sure we're not
- creating non GIMPLE tuples after gimplification. */
- unsigned int gimplified : 1;
-
/* Fields below this point are not set for abstract functions; see
allocate_struct_function. */
extern void instantiate_decl_rtl (rtx x);
/* For backward compatibility... eventually these should all go away. */
-#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_calls_alloca (cfun->calls_alloca)
-#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_stdarg (cfun->stdarg)
-#define current_function_profile (cfun->profile)
#define current_function_funcdef_no (cfun->funcdef_no)
-#define current_function_limit_stack (cfun->limit_stack)
-#define current_function_uses_pic_offset_table (cfun->uses_pic_offset_table)
-#define current_function_uses_const_pool (cfun->uses_const_pool)
-#define current_function_has_nonlocal_label (cfun->has_nonlocal_label)
-#define current_function_saves_all_registers (cfun->saves_all_registers)
-#define current_function_has_nonlocal_goto (cfun->has_nonlocal_goto)
-#define current_function_has_asm_statement (cfun->has_asm_statement)
#define current_loops (cfun->x_current_loops)
#define dom_computed (cfun->cfg->x_dom_computed)
/* We do not construct an accurate cfg in functions which call
setjmp, so just punt to be safe. */
- if (current_function_calls_setjmp)
+ if (cfun->calls_setjmp)
return 0;
/* Assume that we do not need to run jump optimizations after gcse. */
/* We do not construct an accurate cfg in functions which call
setjmp, so just punt to be safe. */
- if (current_function_calls_setjmp)
+ if (cfun->calls_setjmp)
return 0;
/* Identify the basic block information for this function, including
disp_label = create_artificial_label ();
/* This mark will create forward edges from every call site. */
DECL_NONLOCAL (disp_label) = 1;
- current_function_has_nonlocal_label = 1;
+ cfun->has_nonlocal_label = 1;
x = build1 (LABEL_EXPR, void_type_node, disp_label);
tsi_link_after (&i, x, TSI_CONTINUE_LINKING);
DECL_SAVED_TREE (fndecl) = bind;
}
- cfun->gimplified = true;
current_function_decl = oldfn;
pop_cfun ();
}
#endif
int need_fp
= (! flag_omit_frame_pointer
- || (current_function_calls_alloca && EXIT_IGNORE_STACK)
+ || (cfun->calls_alloca && EXIT_IGNORE_STACK)
|| FRAME_POINTER_REQUIRED);
max_regno = max_reg_num ();
if (REG_N_REFS (i) != 0 && REG_LIVE_LENGTH (i) != -1
/* Don't allocate pseudos that cross calls,
if this function receives a nonlocal goto. */
- && (! current_function_has_nonlocal_label
+ && (! cfun->has_nonlocal_label
|| REG_N_CALLS_CROSSED (i) == 0))
{
int blk = regno_basic_block (i);
if (reg_qty[sreg] >= -1
/* If we are not going to let any regs live across calls,
don't tie a call-crossing reg to a non-call-crossing reg. */
- || (current_function_has_nonlocal_label
+ || (cfun->has_nonlocal_label
&& ((REG_N_CALLS_CROSSED (ureg) > 0)
!= (REG_N_CALLS_CROSSED (sreg) > 0))))
return 0;
/* Don't let a pseudo live in a reg across a function call
if we might get a nonlocal goto. */
- if (current_function_has_nonlocal_label
+ if (cfun->has_nonlocal_label
&& qty[qtyno].n_calls_crossed > 0)
return -1;
if (pass->type == SIMPLE_IPA_PASS)
gcc_assert (!cfun && !current_function_decl);
else
- {
- gcc_assert (cfun && current_function_decl);
- gcc_assert (!(cfun->curr_properties & PROP_trees)
- || pass->type != RTL_PASS);
- }
+ gcc_assert (cfun && current_function_decl);
current_pass = pass;
/* See if we're supposed to run this pass. */
dump_file = NULL;
}
+ if (pass->type != SIMPLE_IPA_PASS)
+ gcc_assert (!(cfun->curr_properties & PROP_trees)
+ || pass->type != RTL_PASS);
+
current_pass = NULL;
/* Reset in_gimple_form to not break non-unit-at-a-time mode. */
in_gimple_form = false;
/* No need to record conflicts for call clobbered regs if we have
nonlocal labels around, as we don't ever try to allocate such
regs in this case. */
- if (! current_function_has_nonlocal_label)
+ if (! cfun->has_nonlocal_label)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (call_used_regs [i])
record_one_conflict (allocnos_live, &hard_regs_live, i);
/* A function that has a nonlocal label that can reach the exit
block via non-exceptional paths must save all call-saved
registers. */
- if (current_function_has_nonlocal_label
+ if (cfun->has_nonlocal_label
&& has_nonexceptional_receiver ())
- current_function_saves_all_registers = 1;
+ crtl->saves_all_registers = 1;
- if (current_function_saves_all_registers)
+ if (crtl->saves_all_registers)
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
df_set_regs_ever_live (i, true);
the frame pointer in that case. At some point,
we should improve this by emitting the
sp-adjusting insns for this case. */
- || (current_function_calls_alloca
+ || (cfun->calls_alloca
&& EXIT_IGNORE_STACK)
- || current_function_accesses_prior_frames
+ || crtl->accesses_prior_frames
|| FRAME_POINTER_REQUIRED);
num_eliminable = 0;
/* Assume that the stack pointer is unchanging if alloca hasn't
been used. */
- current_function_sp_is_unchanging = !current_function_calls_alloca;
+ current_function_sp_is_unchanging = !cfun->calls_alloca;
if (current_function_sp_is_unchanging)
FOR_EACH_BB (bb)
FOR_BB_INSNS (bb, insn)
if (real_output_rtx[i])
emit_move_insn (real_output_rtx[i], output_rtx[i]);
- cfun->has_asm_statement = 1;
+ crtl->has_asm_statement = 1;
free_temp_slots ();
}
places. */
save = skip_simple_arithmetic (size);
- if (cfun && cfun->x_dont_save_pending_sizes_p)
+ if (cfun && cfun->dont_save_pending_sizes_p)
/* The front-end doesn't want us to keep a list of the expressions
that determine sizes for variable size objects. Trust it. */
return size;
int flags = call_expr_flags (t);
if (flags & ECF_MAY_BE_ALLOCA)
- current_function_calls_alloca = true;
+ cfun->calls_alloca = true;
if (flags & ECF_RETURNS_TWICE)
- current_function_calls_setjmp = true;
+ cfun->calls_setjmp = true;
}
void
clear_special_calls (void)
{
- current_function_calls_alloca = false;
- current_function_calls_setjmp = false;
+ cfun->calls_alloca = false;
+ cfun->calls_setjmp = false;
}
{
/* A non-pure/const CALL_EXPR alters flow control if the current
function has nonlocal labels. */
- if (TREE_SIDE_EFFECTS (call) && current_function_has_nonlocal_label)
+ if (TREE_SIDE_EFFECTS (call) && cfun->has_nonlocal_label)
return true;
/* A CALL_EXPR also alters control flow if it does not return. */
if (TREE_CODE (t) == WITH_SIZE_EXPR)
t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == CALL_EXPR)
- return TREE_SIDE_EFFECTS (t) && current_function_has_nonlocal_label;
+ return TREE_SIDE_EFFECTS (t) && cfun->has_nonlocal_label;
return false;
}
{
bool changed = tree_purge_dead_eh_edges (bb);
- if (current_function_has_nonlocal_label)
+ if (cfun->has_nonlocal_label)
{
tree stmt = last_stmt (bb);
edge_iterator ei;
call expand_expr to calculate the size of a variable-sized array.
We haven't necessarily assigned RTL to all variables yet, so it's
not safe to try to expand expressions involving them. */
- cfun->x_dont_save_pending_sizes_p = 1;
+ cfun->dont_save_pending_sizes_p = 1;
tree_register_cfg_hooks ();
extern struct gimple_opt_pass pass_nrv;
extern struct gimple_opt_pass pass_mark_used_blocks;
extern struct gimple_opt_pass pass_rename_ssa_copies;
-extern struct gimple_opt_pass pass_expand;
extern struct gimple_opt_pass pass_rest_of_compilation;
extern struct gimple_opt_pass pass_sink_code;
extern struct gimple_opt_pass pass_fre;
extern struct gimple_opt_pass pass_init_datastructures;
extern struct gimple_opt_pass pass_fixup_cfg;
+extern struct rtl_opt_pass pass_expand;
extern struct rtl_opt_pass pass_init_function;
extern struct rtl_opt_pass pass_jump;
extern struct rtl_opt_pass pass_rtl_eh;
gate_optimize_stdarg (void)
{
/* This optimization is only for stdarg functions. */
- return current_function_stdarg != 0;
+ return cfun->stdarg != 0;
}
referenced_var_iterator rvi;
tree var;
- if (current_function_stdarg)
+ if (cfun->stdarg)
return false;
/* No local variable nor structure field should be call-clobbered. We
/* alloca (until we have stack slot life analysis) inhibits
sibling call optimizations, but not tail recursion. */
- if (current_function_calls_alloca)
+ if (cfun->calls_alloca)
return false;
/* If we are using sjlj exceptions, we may need to add a call to
/* Any function that calls setjmp might have longjmp called from
any called function. ??? We really should represent this
properly in the CFG so that this needn't be special cased. */
- if (current_function_calls_setjmp)
+ if (cfun->calls_setjmp)
return false;
/* ??? It is OK if the argument of a function is taken in some cases,
/* When the function starts with a cold section, we need to explicitly
align the hot section and write out the hot section label.
But if the current function is a thunk, we do not have a CFG. */
- if (!current_function_is_thunk
+ if (!crtl->is_thunk
&& BB_PARTITION (ENTRY_BLOCK_PTR->next_bb) == BB_COLD_PARTITION)
{
switch_to_section (text_section);
return NULL_RTX;
/* Record that this function has used a constant pool entry. */
- current_function_uses_const_pool = 1;
+ crtl->uses_const_pool = 1;
/* Decide which pool to use. */
pool = (targetm.use_blocks_for_constant_p (mode, x)
{
rtx insn, link;
- if (!current_function_uses_const_pool && n_deferred_constants == 0)
+ if (!crtl->uses_const_pool && n_deferred_constants == 0)
return;
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))