From 3e0297630411f86aeb2d559cd4b379fec46a4654 Mon Sep 17 00:00:00 2001 From: Jan Hubicka Date: Tue, 8 Apr 2008 01:52:32 +0200 Subject: [PATCH] function.h (rtl): Rename to x_rtl. * function.h (rtl): Rename to x_rtl. (crtl): New define. (return_label, naked_return_label, stack_slot_list, parm_birth_insn, frame_offset, stack_check_probe_note, arg_pointer_save_area, used_temp_slots avail_temp_slots, temp_slot_level, nonlocal_goto_handler_labels): Update accesstors. (rtl): New global variable. (struct function): Move some fileds to rtl_data. (get_arg_pointer_save_area): Update prototype. * builtins.c (expand_builtin_setjmp_receiver): Update call of get_arg_pointer_save_area. * expr.c (init_expr): Update * function.c (get_frame_size): Update (assign_stack_local): Update (expand_function_end): Update. (get_art_pointer_save_area): Update * function.h * emit-rtl.c (rtl): Declare. (regno_reg_rtx): Declare. (first_insn, last_insn, cur_insn_uid, last_location, first_label_num): Update. (gen_reg_rtx): Update. * varasm.c (n_deferred_constatns): Update accestor. (init_varasm_status): Do not allocate varasm_status. (force_const_mem, get_pool_size, output_constant_pool): Update. * stmt.c (force_label_rtx): Do not use x_ prefixes. (expand_nl_goto_receiver): Update get_arg_pointer_save_area. * m32c/m32.c (m32c_leaf_function_p, m32c_function_needs_enter): Update. * sparc/sparc.h (INIT_EXPANDERS): Update. * ia64/ia64.h (INIT_EXPANDERS): Update. From-SVN: r133994 --- gcc/ChangeLog | 33 +++++++++++++++++++++++++ gcc/config/ia64/ia64.h | 2 +- gcc/config/m32c/m32c.c | 16 ++++++------ gcc/config/sparc/sparc.h | 2 +- gcc/emit-rtl.c | 30 +++++++++++------------ gcc/expr.c | 2 +- gcc/function.c | 8 +++--- gcc/function.h | 53 ++++++++++++++++++++++------------------ gcc/varasm.c | 12 ++++----- 9 files changed, 98 insertions(+), 60 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f7cd018d1a0..7867fa1a382 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,36 @@ +2008-04-07 Jan Hubicka + + * function.h (rtl): Rename to x_rtl. + (crtl): New define. + (return_label, naked_return_label, stack_slot_list, parm_birth_insn, + frame_offset, stack_check_probe_note, arg_pointer_save_area, + used_temp_slots avail_temp_slots, temp_slot_level, + nonlocal_goto_handler_labels): Update accesstors. + (rtl): New global variable. + (struct function): Move some fileds to rtl_data. + (get_arg_pointer_save_area): Update prototype. + * builtins.c (expand_builtin_setjmp_receiver): Update call of + get_arg_pointer_save_area. + * expr.c (init_expr): Update + * function.c (get_frame_size): Update + (assign_stack_local): Update + (expand_function_end): Update. + (get_art_pointer_save_area): Update + * function.h + * emit-rtl.c (rtl): Declare. + (regno_reg_rtx): Declare. + (first_insn, last_insn, cur_insn_uid, last_location, first_label_num): + Update. + (gen_reg_rtx): Update. + * varasm.c (n_deferred_constatns): Update accestor. + (init_varasm_status): Do not allocate varasm_status. + (force_const_mem, get_pool_size, output_constant_pool): Update. + * stmt.c (force_label_rtx): Do not use x_ prefixes. + (expand_nl_goto_receiver): Update get_arg_pointer_save_area. + * m32c/m32.c (m32c_leaf_function_p, m32c_function_needs_enter): Update. + * sparc/sparc.h (INIT_EXPANDERS): Update. + * ia64/ia64.h (INIT_EXPANDERS): Update. + 2008-04-07 James E. Wilson * reload.c (push_secondary_reload): Add missing break to for loop. diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h index 618ba24814b..a4306e8cd83 100644 --- a/gcc/config/ia64/ia64.h +++ b/gcc/config/ia64/ia64.h @@ -982,7 +982,7 @@ enum reg_class #define INIT_EXPANDERS \ do { \ ia64_init_expanders (); \ - if (rtl.emit.regno_pointer_align) \ + if (crtl->emit.regno_pointer_align) \ REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = 64; \ } while (0) diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c index 37caaf974fc..f1346f46775 100644 --- a/gcc/config/m32c/m32c.c +++ b/gcc/config/m32c/m32c.c @@ -3889,20 +3889,20 @@ m32c_leaf_function_p (void) struct sequence_stack *seq; int rv; - saved_first = rtl.emit.x_first_insn; - saved_last = rtl.emit.x_last_insn; - for (seq = rtl.emit.sequence_stack; seq && seq->next; seq = seq->next) + saved_first = crtl->emit.x_first_insn; + saved_last = crtl->emit.x_last_insn; + for (seq = crtl->emit.sequence_stack; seq && seq->next; seq = seq->next) ; if (seq) { - rtl.emit.x_first_insn = seq->first; - rtl.emit.x_last_insn = seq->last; + crtl->emit.x_first_insn = seq->first; + crtl->emit.x_last_insn = seq->last; } rv = leaf_function_p (); - rtl.emit.x_first_insn = saved_first; - rtl.emit.x_last_insn = saved_last; + crtl->emit.x_first_insn = saved_first; + crtl->emit.x_last_insn = saved_last; return rv; } @@ -3918,7 +3918,7 @@ m32c_function_needs_enter (void) rtx fb = gen_rtx_REG (Pmode, FB_REGNO); insn = get_insns (); - for (seq = rtl.emit.sequence_stack; + for (seq = crtl->emit.sequence_stack; seq; insn = seq->first, seq = seq->next); diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h index fcea5762334..d1c607c84b1 100644 --- a/gcc/config/sparc/sparc.h +++ b/gcc/config/sparc/sparc.h @@ -953,7 +953,7 @@ extern int sparc_mode_class[]; /* Given the stack bias, the stack pointer isn't actually aligned. */ #define INIT_EXPANDERS \ do { \ - if (rtl.emit.regno_pointer_align && SPARC_STACK_BIAS) \ + if (crtl->emit.regno_pointer_align && SPARC_STACK_BIAS) \ { \ REGNO_POINTER_ALIGN (STACK_POINTER_REGNUM) = BITS_PER_UNIT; \ REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = BITS_PER_UNIT; \ diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 2fe91163346..aa9e96584a1 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -68,7 +68,7 @@ enum machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */ /* Datastructures maintained for currently processed function in RTL form. */ -struct rtl_data rtl; +struct rtl_data x_rtl; /* Indexed by pseudo register number, gives the rtx for that pseudo. Allocated in parallel with regno_pointer_align. @@ -172,11 +172,11 @@ static GTY ((if_marked ("ggc_marked_p"), param_is (struct rtx_def))) static GTY ((if_marked ("ggc_marked_p"), param_is (struct rtx_def))) htab_t const_fixed_htab; -#define first_insn (rtl.emit.x_first_insn) -#define last_insn (rtl.emit.x_last_insn) -#define cur_insn_uid (rtl.emit.x_cur_insn_uid) -#define last_location (rtl.emit.x_last_location) -#define first_label_num (rtl.emit.x_first_label_num) +#define first_insn (crtl->emit.x_first_insn) +#define last_insn (crtl->emit.x_last_insn) +#define cur_insn_uid (crtl->emit.x_cur_insn_uid) +#define last_location (crtl->emit.x_last_location) +#define first_label_num (crtl->emit.x_first_label_num) static rtx make_call_insn_raw (rtx); static rtx change_address_1 (rtx, enum machine_mode, rtx, int); @@ -887,22 +887,22 @@ gen_reg_rtx (enum machine_mode mode) /* Make sure regno_pointer_align, and regno_reg_rtx are large enough to have an element for this pseudo reg number. */ - if (reg_rtx_no == rtl.emit.regno_pointer_align_length) + if (reg_rtx_no == crtl->emit.regno_pointer_align_length) { - int old_size = rtl.emit.regno_pointer_align_length; + int old_size = crtl->emit.regno_pointer_align_length; char *new; rtx *new1; - new = xrealloc (rtl.emit.regno_pointer_align, old_size * 2); + new = xrealloc (crtl->emit.regno_pointer_align, old_size * 2); memset (new + old_size, 0, old_size); - rtl.emit.regno_pointer_align = (unsigned char *) new; + crtl->emit.regno_pointer_align = (unsigned char *) new; new1 = ggc_realloc (regno_reg_rtx, old_size * 2 * sizeof (rtx)); memset (new1 + old_size, 0, old_size * sizeof (rtx)); regno_reg_rtx = new1; - rtl.emit.regno_pointer_align_length = old_size * 2; + crtl->emit.regno_pointer_align_length = old_size * 2; } val = gen_raw_REG (mode, reg_rtx_no); @@ -5009,14 +5009,14 @@ init_emit (void) /* Init the tables that describe all the pseudo regs. */ - rtl.emit.regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101; + crtl->emit.regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101; - rtl.emit.regno_pointer_align - = xcalloc (rtl.emit.regno_pointer_align_length + crtl->emit.regno_pointer_align + = xcalloc (crtl->emit.regno_pointer_align_length * sizeof (unsigned char), 1); regno_reg_rtx - = ggc_alloc (rtl.emit.regno_pointer_align_length * sizeof (rtx)); + = ggc_alloc (crtl->emit.regno_pointer_align_length * sizeof (rtx)); /* Put copies of all the hard registers into regno_reg_rtx. */ memcpy (regno_reg_rtx, diff --git a/gcc/expr.c b/gcc/expr.c index b0690f51c53..98f7c1d8ecd 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -344,7 +344,7 @@ init_expr_target (void) void init_expr (void) { - memset (&rtl.expr, 0, sizeof (rtl.expr)); + memset (&crtl->expr, 0, sizeof (crtl->expr)); } /* Copy data from FROM to TO, where the machine modes are not the same. diff --git a/gcc/function.c b/gcc/function.c index 4f7a1eff1d2..a2fdcaa4066 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -281,10 +281,10 @@ free_after_compilation (struct function *f) VEC_free (int, heap, prologue); VEC_free (int, heap, epilogue); VEC_free (int, heap, sibcall_epilogue); - if (rtl.emit.regno_pointer_align) - free (rtl.emit.regno_pointer_align); + if (crtl->emit.regno_pointer_align) + free (crtl->emit.regno_pointer_align); - memset (&rtl, 0, sizeof (rtl)); + memset (crtl, 0, sizeof (struct rtl_data)); f->eh = NULL; f->machine = NULL; f->cfg = NULL; @@ -3904,7 +3904,7 @@ push_struct_function (tree fndecl) static void prepare_function_start (void) { - gcc_assert (!rtl.emit.x_last_insn); + gcc_assert (!crtl->emit.x_last_insn); init_emit (); init_varasm_status (); init_expr (); diff --git a/gcc/function.h b/gcc/function.h index 6c95dcd1435..5c9d63f11fc 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -87,13 +87,13 @@ struct emit_status GTY(()) FIXME: We could put it into emit_status struct, but gengtype is not able to deal with length attribute nested in top level structures. */ -extern GTY ((length ("rtl.emit.x_reg_rtx_no"))) rtx * regno_reg_rtx; +extern GTY ((length ("crtl->emit.x_reg_rtx_no"))) rtx * regno_reg_rtx; /* For backward compatibility... eventually these should all go away. */ -#define reg_rtx_no (rtl.emit.x_reg_rtx_no) -#define seq_stack (rtl.emit.sequence_stack) +#define reg_rtx_no (crtl->emit.x_reg_rtx_no) +#define seq_stack (crtl->emit.sequence_stack) -#define REGNO_POINTER_ALIGN(REGNO) (rtl.emit.regno_pointer_align[REGNO]) +#define REGNO_POINTER_ALIGN(REGNO) (crtl->emit.regno_pointer_align[REGNO]) struct expr_status GTY(()) { @@ -136,12 +136,12 @@ struct expr_status GTY(()) rtx x_forced_labels; }; -#define pending_stack_adjust (rtl.expr.x_pending_stack_adjust) -#define inhibit_defer_pop (rtl.expr.x_inhibit_defer_pop) -#define saveregs_value (rtl.expr.x_saveregs_value) -#define apply_args_value (rtl.expr.x_apply_args_value) -#define forced_labels (rtl.expr.x_forced_labels) -#define stack_pointer_delta (rtl.expr.x_stack_pointer_delta) +#define pending_stack_adjust (crtl->expr.x_pending_stack_adjust) +#define inhibit_defer_pop (crtl->expr.x_inhibit_defer_pop) +#define saveregs_value (crtl->expr.x_saveregs_value) +#define apply_args_value (crtl->expr.x_apply_args_value) +#define forced_labels (crtl->expr.x_forced_labels) +#define stack_pointer_delta (crtl->expr.x_stack_pointer_delta) struct gimple_df; struct temp_slot; @@ -193,7 +193,7 @@ struct rtl_data GTY(()) rtx x_naked_return_label; /* List (chain of EXPR_LISTs) of all stack slots in this function. - Made for the sake of unshare_all_rtl. */ + Made for the sake of unshare_all_crtl-> */ rtx x_stack_slot_list; /* Place after which to insert the tail_recursion_label if we need one. */ @@ -226,19 +226,24 @@ struct rtl_data GTY(()) int inl_max_label_num; }; -#define return_label (rtl.x_return_label) -#define naked_return_label (rtl.x_naked_return_label) -#define stack_slot_list (rtl.x_stack_slot_list) -#define parm_birth_insn (rtl.x_parm_birth_insn) -#define frame_offset (rtl.x_frame_offset) -#define stack_check_probe_note (rtl.x_stack_check_probe_note) -#define arg_pointer_save_area (rtl.x_arg_pointer_save_area) -#define used_temp_slots (rtl.x_used_temp_slots) -#define avail_temp_slots (rtl.x_avail_temp_slots) -#define temp_slot_level (rtl.x_temp_slot_level) -#define nonlocal_goto_handler_labels (rtl.x_nonlocal_goto_handler_labels) - -extern GTY(()) struct rtl_data rtl; +#define return_label (crtl->x_return_label) +#define naked_return_label (crtl->x_naked_return_label) +#define stack_slot_list (crtl->x_stack_slot_list) +#define parm_birth_insn (crtl->x_parm_birth_insn) +#define frame_offset (crtl->x_frame_offset) +#define stack_check_probe_note (crtl->x_stack_check_probe_note) +#define arg_pointer_save_area (crtl->x_arg_pointer_save_area) +#define used_temp_slots (crtl->x_used_temp_slots) +#define avail_temp_slots (crtl->x_avail_temp_slots) +#define temp_slot_level (crtl->x_temp_slot_level) +#define nonlocal_goto_handler_labels (crtl->x_nonlocal_goto_handler_labels) + +extern GTY(()) struct rtl_data x_rtl; + +/* Accestor to RTL datastructures. We keep them statically allocated now since + we never keep multiple functions. For threaded compiler we might however + want to do differntly. */ +#define crtl (&x_rtl) /* This structure can save all the important global and static variables describing the status of the current function. */ diff --git a/gcc/varasm.c b/gcc/varasm.c index 73110497c8b..fdfb98f37a3 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -70,7 +70,7 @@ struct addr_const; struct constant_descriptor_rtx; struct rtx_constant_pool; -#define n_deferred_constants (rtl.varasm.deferred_constants) +#define n_deferred_constants (crtl->varasm.deferred_constants) /* Number for making the label on the next constant that is stored in memory. */ @@ -3456,8 +3456,8 @@ create_constant_pool (void) void init_varasm_status (void) { - rtl.varasm.pool = create_constant_pool (); - rtl.varasm.deferred_constants = 0; + crtl->varasm.pool = create_constant_pool (); + crtl->varasm.deferred_constants = 0; } /* Given a MINUS expression, simplify it if both sides @@ -3494,7 +3494,7 @@ force_const_mem (enum machine_mode mode, rtx x) /* Decide which pool to use. */ pool = (targetm.use_blocks_for_constant_p (mode, x) ? shared_constant_pool - : rtl.varasm.pool); + : crtl->varasm.pool); /* Lookup the value in the hashtable. */ tmp.constant = x; @@ -3606,7 +3606,7 @@ get_pool_mode (const_rtx addr) int get_pool_size (void) { - return rtl.varasm.pool->offset; + return crtl->varasm.pool->offset; } /* Worker function for output_constant_pool_1. Emit assembly for X @@ -3848,7 +3848,7 @@ static void output_constant_pool (const char *fnname ATTRIBUTE_UNUSED, tree fndecl ATTRIBUTE_UNUSED) { - struct rtx_constant_pool *pool = rtl.varasm.pool; + struct rtx_constant_pool *pool = crtl->varasm.pool; /* It is possible for gcc to call force_const_mem and then to later discard the instructions which refer to the constant. In such a -- 2.30.2