summaryrefslogtreecommitdiff
path: root/gcc/emit-rtl.c
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:53:17 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-07-12 18:53:17 +0000
commit679bcc8d703e71303adf2e956a1496a00cecf854 (patch)
treecafe482a7a09e052682a76fb7e607508ee8298a3 /gcc/emit-rtl.c
parentc346048138d4be57998cc1ee03488c479e68280a (diff)
downloadgcc-679bcc8d703e71303adf2e956a1496a00cecf854.tar.gz
gcc/
* Makefile.in (target-globals.o): Depend on $(RTL_H). * rtl.h: (target_rtl): New structure. (default_target_rtl): Declare. (this_target_rtl): Declare as a variable or define as a macro. (global_rtl, pic_offset_table_rtx, return_address_pointer_rtx): Redefine as macros. * emit-rtl.c (default_target_rtl): New variable. (this_target_rtl): New conditional variable. (global_rtl, static_regno_reg_rtx, pic_offset_table_rtx) (return_address_pointer_rtx): Delete. (initial_regno_reg_rtx): New macro. (init_emit): Use initial_regno_reg_rtx instead of static_regno_reg_rtx. (init_emit_regs): Likewise. * target-globals.h (this_target_rtl): Declare. (target_globals): Add a rtl field. (restore_target_globals): Copy the rtl field to this_target_rtl. * target-globals.c: Include rtl.h. (default_target_globals): Initialize the rtl field. (save_target_globals): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162088 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/emit-rtl.c')
-rw-r--r--gcc/emit-rtl.c48
1 files changed, 9 insertions, 39 deletions
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index da7677a85b7..bb9f63a66d4 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -61,6 +61,13 @@ along with GCC; see the file COPYING3. If not see
#include "params.h"
#include "target.h"
+struct target_rtl default_target_rtl;
+#if SWITCHABLE_TARGET
+struct target_rtl *this_target_rtl = &default_target_rtl;
+#endif
+
+#define initial_regno_reg_rtx (this_target_rtl->x_initial_regno_reg_rtx)
+
/* Commonly used modes. */
enum machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
@@ -84,19 +91,6 @@ rtx * regno_reg_rtx;
static GTY(()) int label_num = 1;
-/* Commonly used rtx's, so that we only need space for one copy.
- These are initialized once for the entire compilation.
- All of these are unique; no other rtx-object will be equal to any
- of these. */
-
-rtx global_rtl[GR_MAX];
-
-/* Commonly used RTL for hard registers. These objects are not necessarily
- unique, so we allocate them separately from global_rtl. They are
- initialized once per compilation unit, then copied into regno_reg_rtx
- at the beginning of each function. */
-static GTY(()) rtx static_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
-
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
the values of 0, 1, and 2. For the integer entries and VOIDmode, we
record a copy of const[012]_rtx. */
@@ -115,30 +109,6 @@ REAL_VALUE_TYPE dconsthalf;
FIXED_VALUE_TYPE fconst0[MAX_FCONST0];
FIXED_VALUE_TYPE fconst1[MAX_FCONST1];
-/* All references to the following fixed hard registers go through
- these unique rtl objects. On machines where the frame-pointer and
- arg-pointer are the same register, they use the same unique object.
-
- After register allocation, other rtl objects which used to be pseudo-regs
- may be clobbered to refer to the frame-pointer register.
- But references that were originally to the frame-pointer can be
- distinguished from the others because they contain frame_pointer_rtx.
-
- When to use frame_pointer_rtx and hard_frame_pointer_rtx is a little
- tricky: until register elimination has taken place hard_frame_pointer_rtx
- should be used if it is being set, and frame_pointer_rtx otherwise. After
- register elimination hard_frame_pointer_rtx should always be used.
- On machines where the two registers are same (most) then these are the
- same.
-
- In an inline procedure, the stack and frame pointer rtxs may not be
- used for anything else. */
-rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */
-
-/* This is used to implement __builtin_return_address for some machines.
- See for instance the MIPS port. */
-rtx return_address_pointer_rtx; /* (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM) */
-
/* We make one copy of (const_int C) where C is in
[- MAX_SAVED_CONST_INT, MAX_SAVED_CONST_INT]
to save space during the compilation and simplify comparisons of
@@ -5576,7 +5546,7 @@ init_emit (void)
/* Put copies of all the hard registers into regno_reg_rtx. */
memcpy (regno_reg_rtx,
- static_regno_reg_rtx,
+ initial_regno_reg_rtx,
FIRST_PSEUDO_REGISTER * sizeof (rtx));
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
@@ -5703,7 +5673,7 @@ init_emit_regs (void)
/* Initialize RTL for commonly used hard registers. These are
copied into regno_reg_rtx as we begin to compile each function. */
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- static_regno_reg_rtx[i] = gen_raw_REG (reg_raw_mode[i], i);
+ initial_regno_reg_rtx[i] = gen_raw_REG (reg_raw_mode[i], i);
#ifdef RETURN_ADDRESS_POINTER_REGNUM
return_address_pointer_rtx