summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-31 17:08:31 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2008-03-31 17:08:31 +0000
commitb079a2076830e2cc0d28c75cc778985bd64ce70c (patch)
tree484f1e4819fe26e37e4e3754778504623c82e3b4 /gcc/emit-rtl.c
parentb0399e1b93548f5e588f7f6f7a83d208888a2974 (diff)
downloadgcc-b079a2076830e2cc0d28c75cc778985bd64ce70c.tar.gz
* builtins.c (expand_builtin_setjmp_receiver): Update call of
get_arg_pointer_save_area. * expr.c (init_expr): Just clear out rtl.expr. * function.c (free_after_compilation): Clear out whole RTL structure. (get_func_frame_size): Merge into ... (get_frame_size): ... this one. (assign_stack_local_1): Merge into ... (assign_stack_local): ... this one. (expand_function_end): Update call of get_arg_pointer_save_area. (get_art_pointer_save_area): Remove cfun argument. * function.h (emit_status): regno_pointer_align does not need length attribute. Move x_regno_reg_rtx to ... (regno_reg_rtx): ... new global array. (reg_rtx_no, seq_stack, REGNO_POINTER_ALIGN): Update accestors. (pending_stack_adjust, inhibit_defer_pop, saveregs_value, apply_args_value, forced_labels, stack_pointer_delta): Update accestors. (struct varasm_status): Move here from varasm.c (struct rtl_data): New. Move here some fields from struct function. (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. * 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. (init_virtual_regs): Do not tate emit_status argument. (init_emit): Do not allocate emit. * varasm.c (varasm_statuc): Move to function.h. (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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@133759 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c61
1 files changed, 33 insertions, 28 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 77889cf9d54..d000ee06b43 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -66,6 +66,16 @@ enum machine_mode word_mode; /* Mode whose width is BITS_PER_WORD. */
enum machine_mode double_mode; /* Mode whose width is DOUBLE_TYPE_SIZE. */
enum machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */
+/* Datastructures maintained for currently processed function in RTL form. */
+
+struct rtl_data rtl;
+
+/* Indexed by pseudo register number, gives the rtx for that pseudo.
+ Allocated in parallel with regno_pointer_align.
+ FIXME: We could put it into emit_status struct, but gengtype is not able to deal
+ with length attribute nested in top level structures. */
+
+rtx * regno_reg_rtx;
/* This is *not* reset after each function. It gives each CODE_LABEL
in the entire compilation a unique label number. */
@@ -162,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 (cfun->emit->x_first_insn)
-#define last_insn (cfun->emit->x_last_insn)
-#define cur_insn_uid (cfun->emit->x_cur_insn_uid)
-#define last_location (cfun->emit->x_last_location)
-#define first_label_num (cfun->emit->x_first_label_num)
+#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)
static rtx make_call_insn_raw (rtx);
static rtx change_address_1 (rtx, enum machine_mode, rtx, int);
@@ -853,7 +863,6 @@ byte_lowpart_offset (enum machine_mode outer_mode,
rtx
gen_reg_rtx (enum machine_mode mode)
{
- struct function *f = cfun;
rtx val;
gcc_assert (can_create_pseudo_p ());
@@ -878,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 == f->emit->regno_pointer_align_length)
+ if (reg_rtx_no == rtl.emit.regno_pointer_align_length)
{
- int old_size = f->emit->regno_pointer_align_length;
+ int old_size = rtl.emit.regno_pointer_align_length;
char *new;
rtx *new1;
- new = ggc_realloc (f->emit->regno_pointer_align, old_size * 2);
+ new = xrealloc (rtl.emit.regno_pointer_align, old_size * 2);
memset (new + old_size, 0, old_size);
- f->emit->regno_pointer_align = (unsigned char *) new;
+ rtl.emit.regno_pointer_align = (unsigned char *) new;
- new1 = ggc_realloc (f->emit->x_regno_reg_rtx,
+ new1 = ggc_realloc (regno_reg_rtx,
old_size * 2 * sizeof (rtx));
memset (new1 + old_size, 0, old_size * sizeof (rtx));
regno_reg_rtx = new1;
- f->emit->regno_pointer_align_length = old_size * 2;
+ rtl.emit.regno_pointer_align_length = old_size * 2;
}
val = gen_raw_REG (mode, reg_rtx_no);
@@ -4789,14 +4798,13 @@ in_sequence_p (void)
/* Put the various virtual registers into REGNO_REG_RTX. */
static void
-init_virtual_regs (struct emit_status *es)
+init_virtual_regs (void)
{
- rtx *ptr = es->x_regno_reg_rtx;
- ptr[VIRTUAL_INCOMING_ARGS_REGNUM] = virtual_incoming_args_rtx;
- ptr[VIRTUAL_STACK_VARS_REGNUM] = virtual_stack_vars_rtx;
- ptr[VIRTUAL_STACK_DYNAMIC_REGNUM] = virtual_stack_dynamic_rtx;
- ptr[VIRTUAL_OUTGOING_ARGS_REGNUM] = virtual_outgoing_args_rtx;
- ptr[VIRTUAL_CFA_REGNUM] = virtual_cfa_rtx;
+ regno_reg_rtx[VIRTUAL_INCOMING_ARGS_REGNUM] = virtual_incoming_args_rtx;
+ regno_reg_rtx[VIRTUAL_STACK_VARS_REGNUM] = virtual_stack_vars_rtx;
+ regno_reg_rtx[VIRTUAL_STACK_DYNAMIC_REGNUM] = virtual_stack_dynamic_rtx;
+ regno_reg_rtx[VIRTUAL_OUTGOING_ARGS_REGNUM] = virtual_outgoing_args_rtx;
+ regno_reg_rtx[VIRTUAL_CFA_REGNUM] = virtual_cfa_rtx;
}
@@ -4970,9 +4978,6 @@ copy_insn (rtx insn)
void
init_emit (void)
{
- struct function *f = cfun;
-
- f->emit = ggc_alloc (sizeof (struct emit_status));
first_insn = NULL;
last_insn = NULL;
cur_insn_uid = 1;
@@ -4983,14 +4988,14 @@ init_emit (void)
/* Init the tables that describe all the pseudo regs. */
- f->emit->regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
+ rtl.emit.regno_pointer_align_length = LAST_VIRTUAL_REGISTER + 101;
- f->emit->regno_pointer_align
- = ggc_alloc_cleared (f->emit->regno_pointer_align_length
- * sizeof (unsigned char));
+ rtl.emit.regno_pointer_align
+ = xmalloc (rtl.emit.regno_pointer_align_length
+ * sizeof (unsigned char));
regno_reg_rtx
- = ggc_alloc (f->emit->regno_pointer_align_length * sizeof (rtx));
+ = ggc_alloc (rtl.emit.regno_pointer_align_length * sizeof (rtx));
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
@@ -4998,7 +5003,7 @@ init_emit (void)
FIRST_PSEUDO_REGISTER * sizeof (rtx));
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
- init_virtual_regs (f->emit);
+ init_virtual_regs ();
/* Indicate that the virtual registers and stack locations are
all pointers. */