This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[8/27] Use target structures for init_alias_target
- From: Richard Sandiford <rdsandiford at googlemail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 07 Jul 2010 21:47:15 +0100
- Subject: [8/27] Use target structures for init_alias_target
- References: <87d3v2oqyt.fsf@firetop.home>
We're now here:
/* This depends on stack_pointer_rtx. */
init_fake_stack_mems ();
/* Sets static_base_value[HARD_FRAME_POINTER_REGNUM], which is
mode-dependent. */
==> init_alias_target ();
/* Depends on HARD_FRAME_POINTER_REGNUM. */
init_reload ();
As far as the covering note goes, I think the alias code counts
as infrastructure rather than a pass, so the patch puts the data
in target_rtl. The data isn't useful to anyone outside alias.c,
so the macro definition is kept local to that file.
Richard
gcc/
* rtl.h (target_rtl): Add x_static_reg_base_value.
* alias.c (static_reg_base_value): Redefine as a macro.
Index: gcc/rtl.h
===================================================================
--- gcc/rtl.h 2010-07-03 23:09:50.000000000 +0100
+++ gcc/rtl.h 2010-07-03 23:10:16.000000000 +0100
@@ -2045,6 +2045,10 @@ struct GTY(()) target_rtl {
/* A sample (mem:M stack_pointer_rtx) rtx for each mode M. */
rtx x_top_of_stack[MAX_MACHINE_MODE];
+
+ /* Static hunks of RTL used by the aliasing code; these are treated
+ as persistent to avoid unnecessary RTL allocations. */
+ rtx x_static_reg_base_value[FIRST_PSEUDO_REGISTER];
};
extern GTY(()) struct target_rtl default_target_rtl;
Index: gcc/alias.c
===================================================================
--- gcc/alias.c 2010-07-03 23:09:49.000000000 +0100
+++ gcc/alias.c 2010-07-03 23:10:55.000000000 +0100
@@ -211,9 +211,8 @@ static GTY(()) VEC(rtx,gc) *reg_base_val
array. */
static GTY((deletable)) VEC(rtx,gc) *old_reg_base_value;
-/* Static hunks of RTL used by the aliasing code; these are initialized
- once per function to avoid unnecessary RTL allocations. */
-static GTY (()) rtx static_reg_base_value[FIRST_PSEUDO_REGISTER];
+#define static_reg_base_value \
+ (this_target_rtl->x_static_reg_base_value)
#define REG_BASE_VALUE(X) \
(REGNO (X) < VEC_length (rtx, reg_base_value) \