===================================================================
@@ -3476,7 +3476,7 @@ lower-subreg.o : lower-subreg.c $(CONFIG
$(EXPR_H) $(EXCEPT_H) $(REGS_H) $(TREE_PASS_H) $(DF_H)
target-globals.o : target-globals.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(TM_H) $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h $(FLAGS_H) \
- $(REGS_H) $(RTL_H)
+ $(REGS_H) $(RTL_H) reload.h
$(out_object_file): $(out_file) $(CONFIG_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) $(REGS_H) hard-reg-set.h insn-config.h conditions.h \
===================================================================
@@ -154,6 +154,37 @@ struct reload
extern int n_reloads;
#endif
+/* Target-dependent globals. */
+struct target_reload {
+ /* Nonzero if indirect addressing is supported when the innermost MEM is
+ of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
+ which these are valid is the same as spill_indirect_levels, above. */
+ bool x_indirect_symref_ok;
+
+ /* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
+ bool x_double_reg_address_ok;
+
+ /* Nonzero if indirect addressing is supported on the machine; this means
+ that spilling (REG n) does not require reloading it into a register in
+ order to do (MEM (REG n)) or (MEM (PLUS (REG n) (CONST_INT c))). The
+ value indicates the level of indirect addressing supported, e.g., two
+ means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
+ a hard register. */
+ bool x_spill_indirect_levels;
+};
+
+extern struct target_reload default_target_reload;
+#if SWITCHABLE_TARGET
+extern struct target_reload *this_target_reload;
+#else
+#define this_target_reload (&default_target_reload)
+#endif
+
+#define indirect_symref_ok \
+ (this_target_reload->x_indirect_symref_ok)
+#define double_reg_address_ok \
+ (this_target_reload->x_double_reg_address_ok)
+
extern GTY (()) VEC(rtx,gc) *reg_equiv_memory_loc_vec;
extern rtx *reg_equiv_constant;
extern rtx *reg_equiv_invariant;
@@ -181,15 +212,6 @@ extern GTY(()) int reg_equiv_init_size;
Used in find_equiv_reg. */
extern int reload_first_uid;
-/* Nonzero if indirect addressing is supported when the innermost MEM is
- of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
- which these are valid is the same as spill_indirect_levels, above. */
-
-extern char indirect_symref_ok;
-
-/* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
-extern char double_reg_address_ok;
-
extern int num_not_at_initial_offset;
#if defined SET_HARD_REG_BIT && defined CLEAR_REG_SET
===================================================================
@@ -81,6 +81,14 @@ Software Foundation; either version 3, o
fixing up each insn, and generating the new insns to copy values
into the reload registers. */
+struct target_reload default_target_reload;
+#if SWITCHABLE_TARGET
+struct target_reload *this_target_reload = &default_target_reload;
+#endif
+
+#define spill_indirect_levels \
+ (this_target_reload->x_spill_indirect_levels)
+
/* During reload_as_needed, element N contains a REG rtx for the hard reg
into which reg N has been reloaded (perhaps for a previous insn). */
static rtx *reg_last_reload_reg;
@@ -231,22 +239,6 @@ VEC(rtx,gc) *reg_equiv_memory_loc_vec;
a round-robin fashion. */
static int last_spill_reg;
-/* Nonzero if indirect addressing is supported on the machine; this means
- that spilling (REG n) does not require reloading it into a register in
- order to do (MEM (REG n)) or (MEM (PLUS (REG n) (CONST_INT c))). The
- value indicates the level of indirect addressing supported, e.g., two
- means that (MEM (MEM (REG n))) is also valid if (REG n) does not get
- a hard register. */
-static char spill_indirect_levels;
-
-/* Nonzero if indirect addressing is supported when the innermost MEM is
- of the form (MEM (SYMBOL_REF sym)). It is assumed that the level to
- which these are valid is the same as spill_indirect_levels, above. */
-char indirect_symref_ok;
-
-/* Nonzero if an address (plus (reg frame_pointer) (reg ...)) is valid. */
-char double_reg_address_ok;
-
/* Record the stack slot for each spilled hard register. */
static rtx spill_stack_slot[FIRST_PSEUDO_REGISTER];
===================================================================
@@ -25,12 +25,14 @@ #define TARGET_GLOBALS_H 1
extern struct target_regs *this_target_regs;
extern struct target_rtl *this_target_rtl;
extern struct target_hard_regs *this_target_hard_regs;
+extern struct target_reload *this_target_reload;
struct GTY(()) target_globals {
struct target_flag_state *GTY((skip)) flag_state;
struct target_regs *GTY((skip)) regs;
struct target_rtl *rtl;
struct target_hard_regs *GTY((skip)) hard_regs;
+ struct target_reload *GTY((skip)) reload;
};
extern struct target_globals default_target_globals;
@@ -44,6 +46,7 @@ restore_target_globals (struct target_gl
this_target_regs = g->regs;
this_target_rtl = g->rtl;
this_target_hard_regs = g->hard_regs;
+ this_target_reload = g->reload;
}
#endif
===================================================================
@@ -29,13 +29,15 @@ Software Foundation; either version 3, o
#include "regs.h"
#include "rtl.h"
#include "hard-reg-set.h"
+#include "reload.h"
#if SWITCHABLE_TARGET
struct target_globals default_target_globals = {
&default_target_flag_state,
&default_target_regs,
&default_target_rtl,
- &default_target_hard_regs
+ &default_target_hard_regs,
+ &default_target_reload
};
struct target_globals *
@@ -48,6 +50,7 @@ save_target_globals (void)
g->regs = XCNEW (struct target_regs);
g->rtl = ggc_alloc_cleared_target_rtl ();
g->hard_regs = XCNEW (struct target_hard_regs);
+ g->reload = XCNEW (struct target_reload);
restore_target_globals (g);
target_reinit ();
return g;