summaryrefslogtreecommitdiff
path: root/gcc/rtl.h
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/rtl.h
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/rtl.h')
-rw-r--r--gcc/rtl.h52
1 files changed, 47 insertions, 5 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 6cc44b914b9..366b5fd8795 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2006,8 +2006,53 @@ enum global_rtl_index
GR_MAX
};
-/* Pointers to standard pieces of rtx are stored here. */
-extern GTY(()) rtx global_rtl[GR_MAX];
+/* Target-dependent globals. */
+struct GTY(()) target_rtl {
+ /* All references to the hard registers in global_rtl_index 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. */
+ rtx x_global_rtl[GR_MAX];
+
+ /* A unique representation of (REG:Pmode PIC_OFFSET_TABLE_REGNUM). */
+ rtx x_pic_offset_table_rtx;
+
+ /* A unique representation of (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM).
+ This is used to implement __builtin_return_address for some machines;
+ see for instance the MIPS port. */
+ rtx x_return_address_pointer_rtx;
+
+ /* 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. */
+ rtx x_initial_regno_reg_rtx[FIRST_PSEUDO_REGISTER];
+};
+
+extern GTY(()) struct target_rtl default_target_rtl;
+#if SWITCHABLE_TARGET
+extern struct target_rtl *this_target_rtl;
+#else
+#define this_target_rtl (&default_target_rtl)
+#endif
+
+#define global_rtl \
+ (this_target_rtl->x_global_rtl)
+#define pic_offset_table_rtx \
+ (this_target_rtl->x_pic_offset_table_rtx)
+#define return_address_pointer_rtx \
+ (this_target_rtl->x_return_address_pointer_rtx)
/* Standard pieces of rtx, to be substituted directly into things. */
#define pc_rtx (global_rtl[GR_PC])
@@ -2021,9 +2066,6 @@ extern GTY(()) rtx global_rtl[GR_MAX];
#define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
-extern GTY(()) rtx pic_offset_table_rtx;
-extern GTY(()) rtx return_address_pointer_rtx;
-
/* Include the RTL generation functions. */
#ifndef GENERATOR_FILE