diff options
author | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-12 18:53:59 +0000 |
---|---|---|
committer | rsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-12 18:53:59 +0000 |
commit | 5f00384a2df620694cde858c379b6fa5060f3692 (patch) | |
tree | 81833811781814bd7dc33b609cd55e47bc56fc7e /gcc | |
parent | eb2c25b54b230c5efbaf84075ed139a8c5508883 (diff) | |
download | gcc-5f00384a2df620694cde858c379b6fa5060f3692.tar.gz |
gcc/
* Makefile.in (target-globals.o): Depend on reload.h.
* reload.h (target_reload): New structure.
(default_target_reload): Declare.
(this_target_reload): Declare as a variable or define as a macro.
(indirect_symref_ok, double_reg_address_ok): Redefine as macros.
* reload1.c (default_target_reload): New variable
(this_target_reload): New conditional variable.
(indirect_symref_ok, double_reg_address_ok): Delete.
(spill_indirect_levels): Redefine as a macro.
* target-globals.h (this_target_reload): Declare.
(target_globals): Add a reload field.
(restore_target_globals): Copy the reload field to
this_target_reload.
* target-globals.c: Include hard-reg-set.h.
(default_target_globals): Initialize the reload field.
(save_target_globals): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162093 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/Makefile.in | 2 | ||||
-rw-r--r-- | gcc/reload.h | 40 | ||||
-rw-r--r-- | gcc/reload1.c | 24 | ||||
-rw-r--r-- | gcc/target-globals.c | 5 | ||||
-rw-r--r-- | gcc/target-globals.h | 3 |
6 files changed, 66 insertions, 27 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5765ed64a0d..21d5e7d74dc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,24 @@ 2010-07-12 Richard Sandiford <rdsandiford@googlemail.com> + * Makefile.in (target-globals.o): Depend on reload.h. + * reload.h (target_reload): New structure. + (default_target_reload): Declare. + (this_target_reload): Declare as a variable or define as a macro. + (indirect_symref_ok, double_reg_address_ok): Redefine as macros. + * reload1.c (default_target_reload): New variable + (this_target_reload): New conditional variable. + (indirect_symref_ok, double_reg_address_ok): Delete. + (spill_indirect_levels): Redefine as a macro. + * target-globals.h (this_target_reload): Declare. + (target_globals): Add a reload field. + (restore_target_globals): Copy the reload field to + this_target_reload. + * target-globals.c: Include hard-reg-set.h. + (default_target_globals): Initialize the reload field. + (save_target_globals): Likewise. + +2010-07-12 Richard Sandiford <rdsandiford@googlemail.com> + * rtl.h (target_rtl): Add x_static_reg_base_value. * alias.c (static_reg_base_value): Redefine as a macro. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index 4c7c0cd6ded..325e97eef1f 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -3477,7 +3477,7 @@ lower-subreg.o : lower-subreg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \ $(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) insn-config.h $(MACHMODE_H) $(GGC_H) $(TOPLEV_H) target-globals.h \ - $(FLAGS_H) $(REGS_H) $(RTL_H) + $(FLAGS_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 \ diff --git a/gcc/reload.h b/gcc/reload.h index a3c1f07bd9f..48b8dfd0386 100644 --- a/gcc/reload.h +++ b/gcc/reload.h @@ -154,6 +154,37 @@ extern struct reload rld[MAX_RELOADS]; 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 int reload_n_operands; 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 diff --git a/gcc/reload1.c b/gcc/reload1.c index 48191a2a00f..437b8c2f286 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -81,6 +81,14 @@ along with GCC; see the file COPYING3. If not see 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 @@ static HARD_REG_SET used_spill_regs; 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]; diff --git a/gcc/target-globals.c b/gcc/target-globals.c index b6906ce0cd5..f78e58d0927 100644 --- a/gcc/target-globals.c +++ b/gcc/target-globals.c @@ -30,13 +30,15 @@ along with GCC; see the file COPYING3. If not see #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 * @@ -49,6 +51,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; diff --git a/gcc/target-globals.h b/gcc/target-globals.h index 913c5120147..677aa94dddf 100644 --- a/gcc/target-globals.h +++ b/gcc/target-globals.h @@ -25,12 +25,14 @@ extern struct target_flag_state *this_target_flag_state; 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_globals *g) this_target_regs = g->regs; this_target_rtl = g->rtl; this_target_hard_regs = g->hard_regs; + this_target_reload = g->reload; } #endif |