Comments
Patch
===================================================================
@@ -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;
===================================================================
@@ -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) \
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.