From e3b5732b21547a1473879859cf26435f7702be4a Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Sat, 26 Apr 2008 01:14:40 +0200 Subject: [PATCH] re PR testsuite/35843 (-fdump-rtl-expand does not exist anymore) 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. From-SVN: r134682 --- gcc/ChangeLog | 249 +++++++++++++++++++++++++++++++++ gcc/bt-load.c | 2 +- gcc/builtins.c | 8 +- gcc/c-decl.c | 2 +- gcc/calls.c | 8 +- gcc/cfgcleanup.c | 2 +- gcc/cfgexpand.c | 8 +- gcc/config/alpha/alpha.c | 24 ++-- gcc/config/alpha/predicates.md | 2 +- gcc/config/arc/arc.c | 2 +- gcc/config/arc/arc.h | 2 +- gcc/config/arm/arm.c | 62 ++++---- gcc/config/arm/arm.h | 4 +- gcc/config/arm/arm.md | 2 +- gcc/config/arm/linux-elf.h | 2 +- gcc/config/avr/avr.c | 2 +- gcc/config/bfin/bfin.c | 16 +-- gcc/config/cris/cris.c | 30 ++-- gcc/config/cris/cris.md | 4 +- gcc/config/crx/crx.h | 2 +- gcc/config/darwin.c | 2 +- gcc/config/fr30/fr30.c | 4 +- gcc/config/frv/frv.c | 4 +- gcc/config/i386/i386.c | 26 ++-- gcc/config/i386/linux.h | 2 +- gcc/config/ia64/ia64.c | 6 +- gcc/config/iq2000/iq2000.c | 10 +- gcc/config/m32r/m32r.c | 20 +-- gcc/config/m32r/m32r.h | 2 +- gcc/config/m32r/m32r.md | 6 +- gcc/config/m68k/m68k.c | 22 +-- gcc/config/mcore/mcore.c | 2 +- gcc/config/mips/mips.c | 26 ++-- gcc/config/mmix/mmix.c | 6 +- gcc/config/mmix/mmix.h | 2 +- gcc/config/mn10300/mn10300.c | 2 +- gcc/config/mt/mt.h | 2 +- gcc/config/pa/pa.c | 20 +-- gcc/config/pa/pa.h | 6 +- gcc/config/pa/pa.md | 4 +- gcc/config/rs6000/rs6000.c | 62 ++++---- gcc/config/rs6000/rs6000.h | 2 +- gcc/config/rs6000/rs6000.md | 2 +- gcc/config/s390/s390.c | 28 ++-- gcc/config/score/score.h | 2 +- gcc/config/score/score3.c | 10 +- gcc/config/score/score7.c | 10 +- gcc/config/sh/sh.c | 18 +-- gcc/config/sh/sh.h | 2 +- gcc/config/sh/sh.md | 2 +- gcc/config/sparc/sparc.c | 20 +-- gcc/config/sparc/sparc.h | 6 +- gcc/config/sparc/sparc.md | 10 +- gcc/config/spu/spu.c | 14 +- gcc/config/stormy16/stormy16.c | 2 +- gcc/config/v850/v850.c | 2 +- gcc/config/xtensa/xtensa.h | 2 +- gcc/cp/ChangeLog | 6 + gcc/cp/decl.c | 2 +- gcc/cp/method.c | 2 +- gcc/cp/typeck.c | 2 +- gcc/df-scan.c | 6 +- gcc/dojump.c | 2 +- gcc/dse.c | 6 +- gcc/dwarf2out.c | 4 +- gcc/emit-rtl.c | 2 +- gcc/except.c | 22 +-- gcc/explow.c | 6 +- gcc/expr.c | 4 +- gcc/final.c | 10 +- gcc/fortran/ChangeLog | 4 + gcc/fortran/trans-decl.c | 2 +- gcc/function.c | 38 ++--- gcc/function.h | 135 +++++++----------- gcc/gcse.c | 4 +- gcc/gimple-low.c | 2 +- gcc/gimplify.c | 1 - gcc/global.c | 4 +- gcc/local-alloc.c | 4 +- gcc/passes.c | 10 +- gcc/ra-conflict.c | 2 +- gcc/reload1.c | 10 +- gcc/stack-ptr-mod.c | 2 +- gcc/stmt.c | 2 +- gcc/stor-layout.c | 2 +- gcc/tree-cfg.c | 14 +- gcc/tree-optimize.c | 2 +- gcc/tree-pass.h | 2 +- gcc/tree-stdarg.c | 2 +- gcc/tree-tailcall.c | 6 +- gcc/varasm.c | 6 +- 91 files changed, 679 insertions(+), 450 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b6824f5ee63..374615b4546 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,252 @@ +2008-04-25 Jan Hubicka + + 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 * optabs.c (expand_float): Fix REG_EQUAL for UNSIGNED_FLOAT libcall. diff --git a/gcc/bt-load.c b/gcc/bt-load.c index 188faeb4f74..6feefbbf7af 100644 --- a/gcc/bt-load.c +++ b/gcc/bt-load.c @@ -508,7 +508,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array, 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; diff --git a/gcc/builtins.c b/gcc/builtins.c index 54cbde53e0e..765294b1be3 100644 --- a/gcc/builtins.c +++ b/gcc/builtins.c @@ -587,7 +587,7 @@ expand_builtin_return_addr (enum built_in_function fndecl_code, int count) 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 @@ -690,10 +690,10 @@ expand_builtin_setjmp_setup (rtx buf_addr, rtx receiver_label) /* 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 @@ -877,7 +877,7 @@ expand_builtin_nonlocal_goto (tree exp) 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. */ diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 872fb8af30b..979b03c36d2 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -6637,7 +6637,7 @@ store_parm_decls (void) 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; } /* Emit diagnostics that require gimple input for detection. Operate on diff --git a/gcc/calls.c b/gcc/calls.c index 7d42de9f13a..126037d4a42 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -399,7 +399,7 @@ emit_call_1 (rtx funexp, tree fntree, tree fndecl ATTRIBUTE_UNUSED, { 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); @@ -2122,7 +2122,7 @@ expand_call (tree exp, rtx target, int ignore) 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 @@ -2299,8 +2299,6 @@ expand_call (tree exp, rtx target, int ignore) 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; @@ -3160,7 +3158,7 @@ expand_call (tree exp, rtx target, int ignore) 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); diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c index 203963e02cc..aae9ca0009d 100644 --- a/gcc/cfgcleanup.c +++ b/gcc/cfgcleanup.c @@ -2176,7 +2176,7 @@ rest_of_handle_jump (void) { delete_unreachable_blocks (); - if (cfun->tail_call_emit) + if (crtl->tail_call_emit) fixup_tail_calls (); return 0; } diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 00abf1e7e53..273c6ac864a 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1177,7 +1177,7 @@ expand_used_vars (void) 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. */ @@ -1874,7 +1874,7 @@ tree_expand_cfg (void) /* 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) @@ -1982,10 +1982,10 @@ tree_expand_cfg (void) 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 */ diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 867bb08dd5c..ed44a88d9ec 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -7072,7 +7072,7 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP) /* 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; @@ -7095,7 +7095,7 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP) } /* We need to restore these for the handler. */ - if (current_function_calls_eh_return) + if (crtl->calls_eh_return) { for (i = 0; ; ++i) { @@ -7149,7 +7149,7 @@ alpha_sa_size (void) 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; @@ -7182,7 +7182,7 @@ alpha_sa_size (void) 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; @@ -7298,18 +7298,18 @@ alpha_does_function_need_gp (void) 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. @@ -7479,7 +7479,7 @@ alpha_expand_prologue (void) 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) @@ -7825,7 +7825,7 @@ alpha_start_function (FILE *file, const char *fnname, 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); @@ -7936,7 +7936,7 @@ alpha_output_function_end_prologue (FILE *file) 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. */ @@ -8002,7 +8002,7 @@ alpha_expand_epilogue (void) 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; @@ -8113,7 +8113,7 @@ alpha_expand_epilogue (void) 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) { diff --git a/gcc/config/alpha/predicates.md b/gcc/config/alpha/predicates.md index 8b00633a44a..bc6fc842980 100644 --- a/gcc/config/alpha/predicates.md +++ b/gcc/config/alpha/predicates.md @@ -268,7 +268,7 @@ 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, diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c index cf0f7b64dfa..b5e2cb96547 100644 --- a/gcc/config/arc/arc.c +++ b/gcc/config/arc/arc.c @@ -1283,7 +1283,7 @@ arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size) 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]; diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h index 06aa4035d1b..ea40fb23ab7 100644 --- a/gcc/config/arc/arc.h +++ b/gcc/config/arc/arc.h @@ -520,7 +520,7 @@ extern enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER]; 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. */ diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c index d788af6740f..82f8352eac2 100644 --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -1656,9 +1656,9 @@ use_return_insn (int iscond, rtx sibling) 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 @@ -3373,7 +3373,7 @@ require_pic_register (void) 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) @@ -3384,7 +3384,7 @@ require_pic_register (void) 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 { @@ -3397,7 +3397,7 @@ require_pic_register (void) 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); @@ -3595,7 +3595,7 @@ arm_load_pic_register (unsigned long saved_regs ATTRIBUTE_UNUSED) 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); @@ -10734,7 +10734,7 @@ arm_compute_save_reg0_reg12_mask (void) 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 @@ -10755,7 +10755,7 @@ arm_compute_save_reg0_reg12_mask (void) && !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. */ @@ -10764,7 +10764,7 @@ arm_compute_save_reg0_reg12_mask (void) } /* Save registers so the exception handler can modify them. */ - if (current_function_calls_eh_return) + if (crtl->calls_eh_return) { unsigned int i; @@ -10825,7 +10825,7 @@ arm_compute_save_reg_mask (void) || (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) @@ -10887,7 +10887,7 @@ thumb1_compute_save_reg_mask (void) 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(). */ @@ -11002,7 +11002,7 @@ output_return_instruction (rtx operand, int really_return, int reverse) return ""; } - gcc_assert (!current_function_calls_alloca || really_return); + gcc_assert (!cfun->calls_alloca || really_return); sprintf (conditional, "%%?%%%c0", reverse ? 'D' : 'd'); @@ -11268,7 +11268,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size) 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; @@ -11315,7 +11315,7 @@ arm_output_epilogue (rtx sibling) /* 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; @@ -11446,7 +11446,7 @@ arm_output_epilogue (rtx sibling) 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); @@ -11463,7 +11463,7 @@ arm_output_epilogue (rtx sibling) 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); @@ -11523,10 +11523,10 @@ arm_output_epilogue (rtx sibling) 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; @@ -11628,7 +11628,7 @@ arm_output_epilogue (rtx sibling) && 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); @@ -11675,7 +11675,7 @@ arm_output_epilogue (rtx sibling) 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); @@ -12133,7 +12133,7 @@ arm_get_frame_offsets (void) } 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. */ @@ -12664,7 +12664,7 @@ arm_expand_prologue (void) 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 ()); @@ -16180,7 +16180,7 @@ thumb_pushpop (FILE *f, unsigned long mask, int push, int *cfa_offset, { /* 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. */ @@ -16255,7 +16255,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr) 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); @@ -16267,7 +16267,7 @@ thumb_exit (FILE *f, int 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; @@ -16278,7 +16278,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr) /* 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 { @@ -16489,7 +16489,7 @@ thumb_exit (FILE *f, int reg_containing_return_addr) 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. */ @@ -16995,7 +16995,7 @@ thumb1_expand_prologue (void) 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 ()); @@ -17045,7 +17045,7 @@ thumb1_expand_epilogue (void) 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, @@ -18633,7 +18633,7 @@ arm_unwind_emit (FILE * asm_out_file, rtx insn) 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; @@ -18722,7 +18722,7 @@ arm_output_fn_unwind (FILE * f, bool prologue) /* 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); diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index a340441d386..b6e182c0d22 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -999,7 +999,7 @@ extern int arm_structure_size_boundary; #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 ())) @@ -2402,7 +2402,7 @@ extern int making_const_table; { \ 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") ; \ diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index dcac1346281..c66ea74d2af 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -10397,7 +10397,7 @@ [(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 (); diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h index 54eba14436f..ca56f7bb669 100644 --- a/gcc/config/arm/linux-elf.h +++ b/gcc/config/arm/linux-elf.h @@ -114,7 +114,7 @@ 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 diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index c440729b422..7248fd6a27c 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -2735,7 +2735,7 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l) int frame_pointer_required_p (void) { - return (current_function_calls_alloca + return (cfun->calls_alloca || crtl->args.info.nregs == 0 || get_frame_size () > 0); } diff --git a/gcc/config/bfin/bfin.c b/gcc/config/bfin/bfin.c index d1a5c80d2a8..87a1d9360b4 100644 --- a/gcc/config/bfin/bfin.c +++ b/gcc/config/bfin/bfin.c @@ -307,7 +307,7 @@ legitimize_pic_address (rtx orig, rtx reg, rtx picreg) 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; } @@ -364,7 +364,7 @@ must_save_p (bool is_inthandler, unsigned regno) 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++) @@ -389,7 +389,7 @@ must_save_p (bool is_inthandler, unsigned regno) && (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 @@ -452,7 +452,7 @@ stack_frame_needed_p (void) { /* 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; } @@ -854,7 +854,7 @@ add_to_reg (rtx reg, HOST_WIDE_INT value, int frame, int epilogue_p) 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; @@ -1167,13 +1167,13 @@ bfin_expand_prologue (void) 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) @@ -1219,7 +1219,7 @@ bfin_expand_prologue (void) 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); } diff --git a/gcc/config/cris/cris.c b/gcc/config/cris/cris.c index 87fef5a2f90..b197956b774 100644 --- a/gcc/config/cris/cris.c +++ b/gcc/config/cris/cris.c @@ -412,13 +412,13 @@ cris_conditional_register_usage (void) 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. @@ -604,7 +604,7 @@ cris_reg_saved_in_regsave_area (unsigned int regno, bool got_really_used) && !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) @@ -1188,7 +1188,7 @@ cris_initial_frame_pointer_offset (void) 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 @@ -1703,7 +1703,7 @@ cris_simple_epilogue (void) || 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. */ @@ -1714,7 +1714,7 @@ cris_simple_epilogue (void) 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 @@ -2751,7 +2751,7 @@ cris_expand_prologue (void) 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 @@ -3030,7 +3030,7 @@ cris_expand_epilogue (void) 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 @@ -3173,7 +3173,7 @@ cris_expand_epilogue (void) 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; @@ -3189,7 +3189,7 @@ cris_expand_epilogue (void) 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, @@ -3231,7 +3231,7 @@ cris_expand_epilogue (void) } /* 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, @@ -3484,7 +3484,7 @@ cris_expand_pic_call_address (rtx *opp) 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 @@ -3519,7 +3519,7 @@ cris_expand_pic_call_address (rtx *opp) 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); @@ -3591,7 +3591,7 @@ cris_asm_output_symbol_ref (FILE *file, rtx x) 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 @@ -3608,7 +3608,7 @@ cris_asm_output_label_ref (FILE *file, char *buf) 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 diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md index 97353cd8df0..e466204786e 100644 --- a/gcc/config/cris/cris.md +++ b/gcc/config/cris/cris.md @@ -995,7 +995,7 @@ /* 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) @@ -1025,7 +1025,7 @@ { /* 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) diff --git a/gcc/config/crx/crx.h b/gcc/config/crx/crx.h index c636dec3fd4..c3e1e203113 100644 --- a/gcc/config/crx/crx.h +++ b/gcc/config/crx/crx.h @@ -277,7 +277,7 @@ enum reg_class #define FIRST_PARM_OFFSET(FNDECL) 0 -#define FRAME_POINTER_REQUIRED (current_function_calls_alloca) +#define FRAME_POINTER_REQUIRED (cfun->calls_alloca) #define ELIMINABLE_REGS \ { \ diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c index 6c2de252fe3..38899833341 100644 --- a/gcc/config/darwin.c +++ b/gcc/config/darwin.c @@ -278,7 +278,7 @@ machopic_function_base_name (void) if (function_base == NULL) function_base = ggc_alloc_string ("", sizeof ("")); - current_function_uses_pic_offset_table = 1; + crtl->uses_pic_offset_table = 1; return function_base; } diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c index 78f7775c658..1dd1a523ac0 100644 --- a/gcc/config/fr30/fr30.c +++ b/gcc/config/fr30/fr30.c @@ -140,7 +140,7 @@ static int fr30_arg_partial_bytes (CUMULATIVE_ARGS *, enum machine_mode, && ! 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) @@ -349,7 +349,7 @@ fr30_expand_prologue (void) RTX_FRAME_RELATED_P (insn) = 1; } - if (current_function_profile) + if (crtl->profile) emit_insn (gen_blockage ()); } diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c index badc45e7ab6..a89c8bb9416 100644 --- a/gcc/config/frv/frv.c +++ b/gcc/config/frv/frv.c @@ -1172,7 +1172,7 @@ frv_stack_info (void) 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)) @@ -1957,7 +1957,7 @@ frv_expand_epilogue (bool emit_return) } /* 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) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 70b650b1658..2df9683f457 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -5783,7 +5783,7 @@ ix86_frame_pointer_required (void) || ix86_current_function_calls_tls_descriptor)) return 1; - if (current_function_profile) + if (crtl->profile) return 1; return 0; @@ -5993,7 +5993,7 @@ gen_push (rtx arg) 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; @@ -6012,16 +6012,16 @@ ix86_save_reg (unsigned int regno, int maybe_eh_return) 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++) @@ -6185,7 +6185,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame) 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; @@ -6196,7 +6196,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame) /* 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; @@ -6246,7 +6246,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame) (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 } @@ -6531,7 +6531,7 @@ ix86_expand_prologue (void) 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 (); @@ -6566,7 +6566,7 @@ ix86_expand_prologue (void) /* 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)); @@ -6621,7 +6621,7 @@ ix86_expand_epilogue (int style) 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; @@ -6643,7 +6643,7 @@ ix86_expand_epilogue (int style) || (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 diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h index ac8149885fc..ec5dc4e2230 100644 --- a/gcc/config/i386/linux.h +++ b/gcc/config/i386/linux.h @@ -55,7 +55,7 @@ along with GCC; see the file COPYING3. If not see 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" diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c index 5b48eba14f5..22d0c0a3ce1 100644 --- a/gcc/config/ia64/ia64.c +++ b/gcc/config/ia64/ia64.c @@ -2379,7 +2379,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size) 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; @@ -2460,7 +2460,7 @@ ia64_compute_frame_size (HOST_WIDE_INT size) /* 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)); @@ -5058,7 +5058,7 @@ ia64_secondary_reload_class (enum reg_class class, /* ??? 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) diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c index 1baf6eb73bb..995b93bdc1d 100644 --- a/gcc/config/iq2000/iq2000.c +++ b/gcc/config/iq2000/iq2000.c @@ -1619,7 +1619,7 @@ compute_frame_size (HOST_WIDE_INT size) /* 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; @@ -1635,7 +1635,7 @@ compute_frame_size (HOST_WIDE_INT size) } /* We need to restore these for the handler. */ - if (current_function_calls_eh_return) + if (crtl->calls_eh_return) { unsigned int i; @@ -2064,7 +2064,7 @@ iq2000_expand_epilogue (void) 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)); @@ -2073,14 +2073,14 @@ iq2000_expand_epilogue (void) 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), diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c index ea4e7f85c5c..64b7e5f63ab 100644 --- a/gcc/config/m32r/m32r.c +++ b/gcc/config/m32r/m32r.c @@ -1253,7 +1253,7 @@ static struct m32r_frame_info zero_frame_info; && (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. */ @@ -1272,8 +1272,8 @@ m32r_compute_frame_size (int size) /* # of var. bytes allocated. */ 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); @@ -1372,8 +1372,8 @@ m32r_expand_prologue (void) 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 ()); @@ -1434,7 +1434,7 @@ m32r_expand_prologue (void) 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))); @@ -1443,10 +1443,10 @@ m32r_expand_prologue (void) { 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 ()); } @@ -1519,7 +1519,7 @@ m32r_expand_epilogue (void) 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 ()); @@ -1664,7 +1664,7 @@ m32r_legitimize_pic_address (rtx orig, rtx reg) 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))) diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h index d1ac1c81d21..0c9e31853ed 100644 --- a/gcc/config/m32r/m32r.h +++ b/gcc/config/m32r/m32r.h @@ -768,7 +768,7 @@ extern enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER]; /* 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 diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md index 84cf4f954e0..b33f624edde 100644 --- a/gcc/config/m32r/m32r.md +++ b/gcc/config/m32r/m32r.md @@ -2354,7 +2354,7 @@ " { if (flag_pic) - current_function_uses_pic_offset_table = 1; + crtl->uses_pic_offset_table = 1; }") (define_insn "*call_via_reg" @@ -2409,7 +2409,7 @@ " { if (flag_pic) - current_function_uses_pic_offset_table = 1; + crtl->uses_pic_offset_table = 1; }") (define_insn "*call_value_via_reg" @@ -2433,7 +2433,7 @@ 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) { diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c index 0c38fbdfd19..3fdd756ada9 100644 --- a/gcc/config/m68k/m68k.c +++ b/gcc/config/m68k/m68k.c @@ -863,20 +863,20 @@ m68k_save_reg (unsigned int regno, bool interrupt_handler) { 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++) @@ -986,7 +986,7 @@ m68k_expand_prologue (void) /* 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); @@ -1073,7 +1073,7 @@ m68k_expand_prologue (void) /* 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)) { @@ -1119,7 +1119,7 @@ m68k_expand_prologue (void) 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)); } @@ -1160,7 +1160,7 @@ m68k_expand_epilogue (bool sibcall_p) 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 @@ -1298,7 +1298,7 @@ m68k_expand_epilogue (bool sibcall_p) 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)); @@ -2046,7 +2046,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, 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; diff --git a/gcc/config/mcore/mcore.c b/gcc/config/mcore/mcore.c index d9d3398b498..940c833dc3e 100644 --- a/gcc/config/mcore/mcore.c +++ b/gcc/config/mcore/mcore.c @@ -1938,7 +1938,7 @@ mcore_expand_prolog (void) 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: diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c index d69169f13a7..94a14274533 100644 --- a/gcc/config/mips/mips.c +++ b/gcc/config/mips/mips.c @@ -7656,12 +7656,12 @@ mips_global_pointer (void) /* 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. @@ -7678,7 +7678,7 @@ mips_global_pointer (void) 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; @@ -7719,7 +7719,7 @@ mips_save_reg_p (unsigned int regno) 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; @@ -7737,7 +7737,7 @@ mips_save_reg_p (unsigned int regno) 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 @@ -7746,7 +7746,7 @@ mips_save_reg_p (unsigned int regno) 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; @@ -7837,7 +7837,7 @@ mips_compute_frame_info (void) 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; @@ -7864,7 +7864,7 @@ mips_compute_frame_info (void) /* 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++; @@ -7952,7 +7952,7 @@ mips_frame_pointer_required (void) { /* 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, @@ -8489,7 +8489,7 @@ mips_expand_prologue (void) /* 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 ()); } @@ -8627,7 +8627,7 @@ mips_expand_epilogue (bool sibcall_p) /* 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) { @@ -8669,7 +8669,7 @@ mips_can_use_return_insn (void) 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 @@ -11475,7 +11475,7 @@ mips_reorg_process_insns (void) /* 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 diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c index 3a408438c62..2807d08d956 100644 --- a/gcc/config/mmix/mmix.c +++ b/gcc/config/mmix/mmix.c @@ -69,7 +69,7 @@ along with GCC; see the file COPYING3. If not see || !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 \ @@ -96,7 +96,7 @@ along with GCC; see the file COPYING3. If not see #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) @@ -2207,7 +2207,7 @@ mmix_expand_epilogue (void) 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. */ diff --git a/gcc/config/mmix/mmix.h b/gcc/config/mmix/mmix.h index 19aab6f4b27..7e38eab1941 100644 --- a/gcc/config/mmix/mmix.h +++ b/gcc/config/mmix/mmix.h @@ -591,7 +591,7 @@ enum reg_class /* 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 diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c index 1effca34473..ea7392bb0f9 100644 --- a/gcc/config/mn10300/mn10300.c +++ b/gcc/config/mn10300/mn10300.c @@ -1599,7 +1599,7 @@ mn10300_function_value (const_tree valtype, const_tree func, int outgoing) 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)); diff --git a/gcc/config/mt/mt.h b/gcc/config/mt/mt.h index 67a8185573d..de20d40eb5a 100644 --- a/gcc/config/mt/mt.h +++ b/gcc/config/mt/mt.h @@ -422,7 +422,7 @@ enum save_direction 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)) \ ) \ ) diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c index 3fff521df55..525572eb7c0 100644 --- a/gcc/config/pa/pa.c +++ b/gcc/config/pa/pa.c @@ -698,7 +698,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) 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) @@ -745,7 +745,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg) 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); @@ -3531,7 +3531,7 @@ compute_frame_size (HOST_WIDE_INT size, int *fregs_live) /* 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; @@ -3679,7 +3679,7 @@ hppa_expand_prologue (void) /* 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; @@ -3779,7 +3779,7 @@ hppa_expand_prologue (void) /* 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; @@ -3811,7 +3811,7 @@ hppa_expand_prologue (void) /* 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; @@ -4113,7 +4113,7 @@ hppa_expand_epilogue (void) /* 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; @@ -4141,7 +4141,7 @@ hppa_expand_epilogue (void) /* 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; @@ -4238,7 +4238,7 @@ hppa_expand_epilogue (void) 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; @@ -8496,7 +8496,7 @@ borx_reg_operand (rtx op, enum machine_mode mode) 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; diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index bcbacb4c69c..541f2e3069f 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -366,13 +366,13 @@ typedef struct machine_function GTY(()) /* 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. @@ -791,7 +791,7 @@ extern int may_call_alloca; #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.\ diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md index ee6037a75b6..5f1d73893fd 100644 --- a/gcc/config/pa/pa.md +++ b/gcc/config/pa/pa.md @@ -7275,7 +7275,7 @@ (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")]) @@ -7317,7 +7317,7 @@ 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 (); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index bf209630a48..ec9f83173d4 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -11465,7 +11465,7 @@ rs6000_got_register (rtx value ATTRIBUTE_UNUSED) && !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; } @@ -14144,7 +14144,7 @@ first_reg_to_save (void) #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 @@ -14181,7 +14181,7 @@ first_altivec_reg_to_save (void) /* 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; @@ -14205,7 +14205,7 @@ compute_vrsave_mask (void) /* 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; @@ -14247,7 +14247,7 @@ compute_save_world_info (rs6000_stack_t *info_ptr) 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 @@ -14432,7 +14432,7 @@ rs6000_stack_info (void) 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 @@ -14468,14 +14468,14 @@ rs6000_stack_info (void) /* 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 ()) { @@ -14496,7 +14496,7 @@ rs6000_stack_info (void) /* 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) @@ -14715,9 +14715,9 @@ spe_func_has_64bit_regs_p (void) /* 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 (); @@ -14969,7 +14969,7 @@ rs6000_ra_ever_killed (void) 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, @@ -15125,7 +15125,7 @@ rs6000_emit_eh_reg_restore (rtx source, rtx scratch) rtx tmp; if (frame_pointer_needed - || current_function_calls_alloca + || cfun->calls_alloca || info->total_size > 32767) { tmp = gen_frame_mem (Pmode, frame_rtx); @@ -15264,7 +15264,7 @@ rs6000_emit_allocate_stack (HOST_WIDE_INT size, int copy_r12) return; } - if (current_function_limit_stack) + if (crtl->limit_stack) { if (REG_P (stack_limit_rtx) && REGNO (stack_limit_rtx) > 1 @@ -15620,14 +15620,14 @@ rs6000_emit_prologue (void) && 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; @@ -15670,7 +15670,7 @@ rs6000_emit_prologue (void) && 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); @@ -15967,7 +15967,7 @@ rs6000_emit_prologue (void) /* ??? 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; @@ -16033,7 +16033,7 @@ rs6000_emit_prologue (void) /* 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; @@ -16161,7 +16161,7 @@ rs6000_emit_prologue (void) #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 (); @@ -16280,11 +16280,11 @@ rs6000_emit_epilogue (int sibcall) && 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 @@ -16311,7 +16311,7 @@ rs6000_emit_epilogue (int sibcall) + 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); @@ -16473,7 +16473,7 @@ rs6000_emit_epilogue (int sibcall) } 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, @@ -16553,7 +16553,7 @@ rs6000_emit_epilogue (int sibcall) 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; @@ -16750,7 +16750,7 @@ rs6000_emit_epilogue (int sibcall) : 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 @@ -16880,7 +16880,7 @@ rs6000_output_function_epilogue (FILE *file, 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; @@ -17864,13 +17864,13 @@ output_profile_hook (int labelno ATTRIBUTE_UNUSED) 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), @@ -20646,7 +20646,7 @@ rs6000_elf_declare_function_name (FILE *file, const char *name, tree decl) if (TARGET_RELOCATABLE && !TARGET_SECURE_PLT - && (get_pool_size () != 0 || current_function_profile) + && (get_pool_size () != 0 || crtl->profile) && uses_TOC ()) { char buf[256]; diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h index ed20d8bd024..1bde282172b 100644 --- a/gcc/config/rs6000/rs6000.h +++ b/gcc/config/rs6000/rs6000.h @@ -1552,7 +1552,7 @@ typedef struct rs6000_args #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)) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index cac5fd1f36b..8cd405e9275 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -10396,7 +10396,7 @@ 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, diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index f2a1947f5ae..6dab692c2a6 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -6438,9 +6438,9 @@ s390_regs_ever_clobbered (int *regs_ever_clobbered) 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; @@ -6449,7 +6449,7 @@ s390_regs_ever_clobbered (int *regs_ever_clobbered) 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; @@ -6554,16 +6554,16 @@ s390_register_info (int clobbered_regs[]) || 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]) @@ -6616,7 +6616,7 @@ s390_register_info (int clobbered_regs[]) } } - if (current_function_stdarg) + if (cfun->stdarg) { /* Varargs functions need to save gprs 2 to 6. */ if (cfun->va_list_gpr_size @@ -6738,8 +6738,8 @@ s390_frame_info (void) && !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) @@ -6800,7 +6800,7 @@ s390_init_frame_layout (void) /* 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)); @@ -6961,8 +6961,8 @@ s390_can_eliminate (int from, int to) /* 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; @@ -7075,7 +7075,7 @@ save_gprs (rtx base, int offset, int first, int last) 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); diff --git a/gcc/config/score/score.h b/gcc/config/score/score.h index ffb5af891ee..fe6e6f9b770 100644 --- a/gcc/config/score/score.h +++ b/gcc/config/score/score.h @@ -549,7 +549,7 @@ extern enum reg_class score_char_to_class[256]; 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}, \ diff --git a/gcc/config/score/score3.c b/gcc/config/score/score3.c index 1399bee15cb..3114bcd1c55 100644 --- a/gcc/config/score/score3.c +++ b/gcc/config/score/score3.c @@ -189,7 +189,7 @@ score3_compute_frame_size (HOST_WIDE_INT size) 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; @@ -202,7 +202,7 @@ score3_compute_frame_size (HOST_WIDE_INT size) } } - if (current_function_calls_eh_return) + if (crtl->calls_eh_return) { unsigned int i; for (i = 0;; ++i) @@ -1467,7 +1467,7 @@ rpush (int rd, int cnt) 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) @@ -1581,7 +1581,7 @@ rpop (int rd, int cnt) 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) @@ -1625,7 +1625,7 @@ score3_epilogue (int sibcall_p) 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)); diff --git a/gcc/config/score/score7.c b/gcc/config/score/score7.c index 2796e2e0d24..74031c2c6ae 100644 --- a/gcc/config/score/score7.c +++ b/gcc/config/score/score7.c @@ -188,7 +188,7 @@ score7_compute_frame_size (HOST_WIDE_INT size) 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; @@ -201,7 +201,7 @@ score7_compute_frame_size (HOST_WIDE_INT size) } } - if (current_function_calls_eh_return) + if (crtl->calls_eh_return) { unsigned int i; for (i = 0;; ++i) @@ -1428,7 +1428,7 @@ score7_prologue (void) 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))); } @@ -1508,7 +1508,7 @@ score7_epilogue (int sibcall_p) 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)); @@ -1521,7 +1521,7 @@ score7_epilogue (int sibcall_p) 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)); diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c index 6b20ee3071d..cd1013dfdc6 100644 --- a/gcc/config/sh/sh.c +++ b/gcc/config/sh/sh.c @@ -5646,7 +5646,7 @@ output_stack_adjust (int size, rtx reg, int epilogue_p, } 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++) @@ -5980,7 +5980,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask) 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; ) @@ -6010,7 +6010,7 @@ calc_live_regs (HARD_REG_SET *live_regs_mask) || (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) @@ -6160,7 +6160,7 @@ sh5_schedule_saves (HARD_REG_SET *live_regs_mask, save_schedule *schedule, && ! 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))))) @@ -6305,7 +6305,7 @@ sh_expand_prologue (void) } /* Emit the code for SETUP_VARARGS. */ - if (current_function_stdarg) + if (cfun->stdarg) { if (TARGET_VARARGS_PRETEND_ARGS (current_function_decl)) { @@ -6850,7 +6850,7 @@ sh_expand_epilogue (bool sibcall_p) + 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)); @@ -7864,7 +7864,7 @@ sh_setup_incoming_varargs (CUMULATIVE_ARGS *ca, 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; @@ -9216,7 +9216,7 @@ sh_allocate_initial_value (rtx hard_reg) && ! (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); @@ -10612,7 +10612,7 @@ sh_get_pr_initial_val (void) 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 diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h index eb37106348f..67a6e3923fb 100644 --- a/gcc/config/sh/sh.h +++ b/gcc/config/sh/sh.h @@ -1359,7 +1359,7 @@ extern char sh_additional_register_names[ADDREGNAMES_SIZE] \ #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) diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md index cfcf1b23d19..837fd2e0484 100644 --- a/gcc/config/sh/sh.md +++ b/gcc/config/sh/sh.md @@ -5067,7 +5067,7 @@ label: [(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); }") diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 962ed9fe3bc..2758e4d8485 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -2639,7 +2639,7 @@ eligible_for_return_delay (rtx trial) /* 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. */ @@ -3084,7 +3084,7 @@ sparc_tls_got (void) rtx temp; if (flag_pic) { - current_function_uses_pic_offset_table = 1; + crtl->uses_pic_offset_table = 1; return pic_offset_table_rtx; } @@ -3300,7 +3300,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, 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. */ @@ -3342,7 +3342,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode ATTRIBUTE_UNUSED, /* ??? 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; } @@ -3479,7 +3479,7 @@ sparc_emit_call_insn (rtx pat, rtx addr) : !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; } } @@ -4099,7 +4099,7 @@ sparc_expand_prologue (void) 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); } @@ -4235,7 +4235,7 @@ output_return (rtx insn) 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+%)%#"; } @@ -4246,7 +4246,7 @@ output_return (rtx insn) 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. */ @@ -6780,7 +6780,7 @@ print_operand (FILE *file, rtx x, int code) 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) @@ -7863,7 +7863,7 @@ sparc_function_ok_for_sibcall (tree decl, tree exp ATTRIBUTE_UNUSED) { 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))); diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index eed016470b1..e9f0f2ab5c2 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -1678,11 +1678,11 @@ do { \ #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)) /* Length in units of the trampoline for entering a nested function. */ @@ -1724,7 +1724,7 @@ do { \ /* 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]. */ diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md index daf172ccbb1..c02c7094df2 100644 --- a/gcc/config/sparc/sparc.md +++ b/gcc/config/sparc/sparc.md @@ -137,10 +137,10 @@ (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")) @@ -1844,7 +1844,7 @@ (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 ()) { @@ -1993,7 +1993,7 @@ (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 ()) { @@ -7237,7 +7237,7 @@ [(unspec_volatile [(const_int 0)] UNSPECV_SETJMP)] "" { - if (! current_function_calls_alloca) + if (! cfun->calls_alloca) return ""; if (! TARGET_V9) return "\tta\t3\n"; diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c index d37f27bc179..ad41994d5a5 100644 --- a/gcc/config/spu/spu.c +++ b/gcc/config/spu/spu.c @@ -1592,7 +1592,7 @@ spu_split_immediate (rtx * ops) { 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; } @@ -1618,7 +1618,7 @@ need_to_save_reg (int regno, int saving) 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; @@ -1739,7 +1739,7 @@ spu_expand_prologue (void) 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; @@ -1753,7 +1753,7 @@ spu_expand_prologue (void) + 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 @@ -1776,7 +1776,7 @@ spu_expand_prologue (void) } } - 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)); @@ -1878,12 +1878,12 @@ spu_expand_epilogue (bool sibcall_p) + 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); diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c index 99aea1ce660..6cbe52d5048 100644 --- a/gcc/config/stormy16/stormy16.c +++ b/gcc/config/stormy16/stormy16.c @@ -996,7 +996,7 @@ xstormy16_compute_stack_layout (void) 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; diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c index c99841a31a4..2a0f3093641 100644 --- a/gcc/config/v850/v850.c +++ b/gcc/config/v850/v850.c @@ -1386,7 +1386,7 @@ compute_register_save_size (long * p_reg_saved) 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; diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h index b78b25f5aa8..17fd4971fa6 100644 --- a/gcc/config/xtensa/xtensa.h +++ b/gcc/config/xtensa/xtensa.h @@ -23,7 +23,7 @@ along with GCC; see the file COPYING3. If not see #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. */ diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 9c116c31ef2..74b1b15a223 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2008-04-25 Jan Hubicka + + * typeck.c (check_return_expr): Update. + * decl.c (start_preparsed_function): Update. + * method.c (use_thunk): Update. + 2008-04-24 Jakub Jelinek PR c++/35758 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 76950c3c2f0..221b30040d7 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11278,7 +11278,7 @@ start_preparsed_function (tree decl1, tree attrs, int flags) 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 (); diff --git a/gcc/cp/method.c b/gcc/cp/method.c index 03cd4439090..45358b2c5f4 100644 --- a/gcc/cp/method.c +++ b/gcc/cp/method.c @@ -437,7 +437,7 @@ use_thunk (tree thunk_fndecl, bool emit_p) 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, diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index cd733bfe326..42779562a88 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -7138,7 +7138,7 @@ check_return_expr (tree retval, bool *no_warning) 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, diff --git a/gcc/df-scan.c b/gcc/df-scan.c index 4a733d6955c..79714e92a08 100644 --- a/gcc/df-scan.c +++ b/gcc/df-scan.c @@ -3871,7 +3871,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses) #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); @@ -3883,7 +3883,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses) #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)) @@ -3893,7 +3893,7 @@ df_get_exit_block_use_set (bitmap exit_block_uses) #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)) diff --git a/gcc/dojump.c b/gcc/dojump.c index e7afb7ef0a8..e1d2fb2c5c3 100644 --- a/gcc/dojump.c +++ b/gcc/dojump.c @@ -70,7 +70,7 @@ void 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 (); diff --git a/gcc/dse.c b/gcc/dse.c index 9d19b7071ee..6984e19bd95 100644 --- a/gcc/dse.c +++ b/gcc/dse.c @@ -531,7 +531,7 @@ struct clear_alias_mode_holder 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; @@ -718,7 +718,7 @@ dse_step0 (void) 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 (); @@ -2163,7 +2163,7 @@ dse_step1 (void) && (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) diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 2c7f3184e7c..7625947049d 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -2657,8 +2657,8 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, 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; diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index b8b19d6d224..2fc2f92126a 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -678,7 +678,7 @@ gen_tmp_stack_mem (enum machine_mode mode, rtx addr) { 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; } diff --git a/gcc/except.c b/gcc/except.c index 9480658b506..f8bacd5902b 100644 --- a/gcc/except.c +++ b/gcc/except.c @@ -1691,7 +1691,7 @@ sjlj_assign_call_site_values (rtx dispatch_label, struct sjlj_lp_info *lp_info) 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); @@ -1817,7 +1817,7 @@ sjlj_emit_function_enter (rtx dispatch_label) 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; @@ -2746,7 +2746,7 @@ can_throw_external (const_rtx insn) 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) @@ -2761,13 +2761,13 @@ 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; @@ -2779,7 +2779,7 @@ set_nothrow_function_flags (void) if (!CALL_P (insn) || !SIBLING_CALL_P (insn)) { - cfun->all_throwers_are_sibcalls = 0; + crtl->all_throwers_are_sibcalls = 0; return 0; } } @@ -2792,7 +2792,7 @@ set_nothrow_function_flags (void) if (!CALL_P (insn) || !SIBLING_CALL_P (insn)) { - cfun->all_throwers_are_sibcalls = 0; + crtl->all_throwers_are_sibcalls = 0; return 0; } } @@ -2829,7 +2829,7 @@ expand_builtin_unwind_init (void) { /* 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 (); @@ -2952,7 +2952,7 @@ expand_eh_return (void) 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); @@ -3248,7 +3248,7 @@ convert_to_eh_region_ranges (void) /* 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. */ @@ -3599,7 +3599,7 @@ output_function_exception_table (const char * ARG_UNUSED (fnname)) 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) diff --git a/gcc/explow.c b/gcc/explow.c index 77d814789e4..d3cc01b9701 100644 --- a/gcc/explow.c +++ b/gcc/explow.c @@ -1081,7 +1081,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) 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) @@ -1129,7 +1129,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) 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; @@ -1236,7 +1236,7 @@ allocate_dynamic_stack_space (rtx size, rtx target, int known_align) #endif /* Check stack bounds if necessary. */ - if (current_function_limit_stack) + if (crtl->limit_stack) { rtx available; rtx space_available = gen_label_rtx (); diff --git a/gcc/expr.c b/gcc/expr.c index 1bb3d820c8c..141904f1231 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -4339,8 +4339,8 @@ expand_assignment (tree to, tree from, bool nontemporal) 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; diff --git a/gcc/final.c b/gcc/final.c index 177c17687d5..ccef70f00f1 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1505,7 +1505,7 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file, /* 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 */ @@ -1550,7 +1550,7 @@ static void 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 */ } @@ -1562,7 +1562,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED) # 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; @@ -3813,7 +3813,7 @@ leaf_function_p (void) 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)) @@ -3888,7 +3888,7 @@ only_leaf_regs_used (void) && ! 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)]) diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index b469063990e..ee39ef18c3c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,7 @@ +2008-04-25 Jan Hubicka + + * trans-decl.c (trans_function_start): Update. + 2008-04-25 Tobias Burnus Daniel Franke diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 84b059b1a78..4e6dddbf501 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -1601,7 +1601,7 @@ trans_function_start (gfc_symbol * sym) 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); diff --git a/gcc/function.c b/gcc/function.c index c804c5e32f0..5d70ddd3f9f 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -1969,7 +1969,7 @@ assign_parms_augmented_arg_list (struct assign_parm_data_all *all) /* 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)); @@ -2008,7 +2008,7 @@ assign_parm_find_data_types (struct assign_parm_data_all *all, tree parm, 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. */ @@ -2967,7 +2967,7 @@ assign_parms (tree fndecl) 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. */ @@ -3859,12 +3859,12 @@ allocate_struct_function (tree fndecl, bool abstract_p) 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))) @@ -4103,11 +4103,11 @@ expand_function_start (tree subr) 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 @@ -4126,7 +4126,7 @@ expand_function_start (tree subr) 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); @@ -4244,7 +4244,7 @@ expand_function_start (tree subr) parm_birth_insn = get_last_insn (); - if (current_function_profile) + if (crtl->profile) { #ifdef PROFILE_HOOK PROFILE_HOOK (current_function_funcdef_no); @@ -4366,7 +4366,7 @@ expand_function_end (void) /* 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, @@ -4523,9 +4523,9 @@ expand_function_end (void) 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)); @@ -4584,7 +4584,7 @@ expand_function_end (void) 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; @@ -4610,7 +4610,7 @@ get_arg_pointer_save_area (void) arg_pointer_save_area = ret; } - if (! cfun->arg_pointer_save_area_init) + if (! crtl->arg_pointer_save_area_init) { rtx seq; @@ -4737,7 +4737,7 @@ thread_prologue_and_epilogue_insns (void) /* 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. */ @@ -4748,7 +4748,7 @@ thread_prologue_and_epilogue_insns (void) /* 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 @@ -5343,7 +5343,7 @@ rest_of_match_asm_constraints (void) 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); diff --git a/gcc/function.h b/gcc/function.h index e98ffff88e7..2e88f97ad7f 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -334,6 +334,59 @@ struct rtl_data GTY(()) /* 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) @@ -437,50 +490,10 @@ struct function GTY(()) 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; @@ -491,34 +504,10 @@ struct function GTY(()) 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. */ @@ -563,23 +552,7 @@ extern void pop_cfun (void); 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) diff --git a/gcc/gcse.c b/gcc/gcse.c index 20bb0804d2e..477d4d3ef07 100644 --- a/gcc/gcse.c +++ b/gcc/gcse.c @@ -658,7 +658,7 @@ gcse_main (rtx f ATTRIBUTE_UNUSED) /* 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. */ @@ -6575,7 +6575,7 @@ bypass_jumps (void) /* 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 diff --git a/gcc/gimple-low.c b/gcc/gimple-low.c index 89de67a088c..fd1a19dfd32 100644 --- a/gcc/gimple-low.c +++ b/gcc/gimple-low.c @@ -122,7 +122,7 @@ lower_function_body (void) 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); diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 12db4e4d35d..2e8ffef4430 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -6603,7 +6603,6 @@ gimplify_function_tree (tree fndecl) DECL_SAVED_TREE (fndecl) = bind; } - cfun->gimplified = true; current_function_decl = oldfn; pop_cfun (); } diff --git a/gcc/global.c b/gcc/global.c index f88da110321..befdc9f367c 100644 --- a/gcc/global.c +++ b/gcc/global.c @@ -249,7 +249,7 @@ compute_regsets (HARD_REG_SET *elim_set, #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 (); @@ -378,7 +378,7 @@ global_alloc (void) 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); diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 33e5a297c1d..af97caf0173 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -2008,7 +2008,7 @@ combine_regs (rtx usedreg, rtx setreg, int may_save_copy, int insn_number, 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; @@ -2229,7 +2229,7 @@ find_free_reg (enum reg_class class, enum machine_mode mode, int qtyno, /* 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; diff --git a/gcc/passes.c b/gcc/passes.c index b8ed3e6f76a..2d05171e712 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1074,11 +1074,7 @@ execute_one_pass (struct opt_pass *pass) 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. */ @@ -1174,6 +1170,10 @@ execute_one_pass (struct opt_pass *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; diff --git a/gcc/ra-conflict.c b/gcc/ra-conflict.c index a4f9e5f4ea1..f97d9a89ee2 100644 --- a/gcc/ra-conflict.c +++ b/gcc/ra-conflict.c @@ -1220,7 +1220,7 @@ global_conflicts (void) /* 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); diff --git a/gcc/reload1.c b/gcc/reload1.c index 7dc593f68ad..13b8e6f7ef0 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -742,11 +742,11 @@ reload (rtx first, int global) /* 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); @@ -3721,9 +3721,9 @@ init_elim_table (void) 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; diff --git a/gcc/stack-ptr-mod.c b/gcc/stack-ptr-mod.c index e37fcc3e302..99e5f75178f 100644 --- a/gcc/stack-ptr-mod.c +++ b/gcc/stack-ptr-mod.c @@ -57,7 +57,7 @@ notice_stack_pointer_modification (void) /* 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) diff --git a/gcc/stmt.c b/gcc/stmt.c index aeea50970f6..ba4c49d4d87 100644 --- a/gcc/stmt.c +++ b/gcc/stmt.c @@ -1077,7 +1077,7 @@ expand_asm_operands (tree string, tree outputs, tree inputs, 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 (); } diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c index 67e4c25fbdc..41c8fefc108 100644 --- a/gcc/stor-layout.c +++ b/gcc/stor-layout.c @@ -138,7 +138,7 @@ variable_size (tree size) 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; diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index d45b277b512..5dc9d045a90 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1808,9 +1808,9 @@ notice_special_calls (tree t) 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; } @@ -1820,8 +1820,8 @@ notice_special_calls (tree t) void clear_special_calls (void) { - current_function_calls_alloca = false; - current_function_calls_setjmp = false; + cfun->calls_alloca = false; + cfun->calls_setjmp = false; } @@ -2495,7 +2495,7 @@ is_ctrl_altering_stmt (const_tree t) { /* 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. */ @@ -2545,7 +2545,7 @@ tree_can_make_abnormal_goto (const_tree t) 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; } @@ -6580,7 +6580,7 @@ tree_purge_dead_abnormal_call_edges (basic_block bb) { 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; diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c index b6a9b93ef28..8c53e6f28b6 100644 --- a/gcc/tree-optimize.c +++ b/gcc/tree-optimize.c @@ -411,7 +411,7 @@ tree_rest_of_compilation (tree fndecl) 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 (); diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 0934e14a055..b82e62024cd 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -335,7 +335,6 @@ extern struct gimple_opt_pass pass_simple_dse; 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; @@ -373,6 +372,7 @@ extern struct gimple_opt_pass pass_free_datastructures; 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; diff --git a/gcc/tree-stdarg.c b/gcc/tree-stdarg.c index 54693d11bec..f1595fe99bc 100644 --- a/gcc/tree-stdarg.c +++ b/gcc/tree-stdarg.c @@ -595,7 +595,7 @@ static bool gate_optimize_stdarg (void) { /* This optimization is only for stdarg functions. */ - return current_function_stdarg != 0; + return cfun->stdarg != 0; } diff --git a/gcc/tree-tailcall.c b/gcc/tree-tailcall.c index a4430ec34e2..0458c8aec60 100644 --- a/gcc/tree-tailcall.c +++ b/gcc/tree-tailcall.c @@ -135,7 +135,7 @@ suitable_for_tail_opt_p (void) 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 @@ -164,7 +164,7 @@ suitable_for_tail_call_opt_p (void) /* 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 @@ -176,7 +176,7 @@ suitable_for_tail_call_opt_p (void) /* 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, diff --git a/gcc/varasm.c b/gcc/varasm.c index 518fe8a7054..7c860d6830b 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1633,7 +1633,7 @@ assemble_start_function (tree decl, const char *fnname) /* 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); @@ -3486,7 +3486,7 @@ force_const_mem (enum machine_mode mode, rtx x) 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) @@ -3800,7 +3800,7 @@ mark_constant_pool (void) { 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)) -- 2.30.2