aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2010-07-12 19:03:43 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2010-07-12 19:03:43 +0000
commitcc14227fd9aadda127a94a28d34eaa4249df3f12 (patch)
tree17257bf331c6a9f21e3d19df584d3f0ecf1671bb
parentfa19795ec4394113e1d79f4660d97b2da23cfaca (diff)
downloadgcc-cc14227fd9aadda127a94a28d34eaa4249df3f12.zip
gcc-cc14227fd9aadda127a94a28d34eaa4249df3f12.tar.gz
gcc-cc14227fd9aadda127a94a28d34eaa4249df3f12.tar.bz2
reload.h (target_reload): Add x_cached_reg_save_code and x_cached_reg_restore_code.
gcc/ * reload.h (target_reload): Add x_cached_reg_save_code and x_cached_reg_restore_code. * caller-save.c (cached_reg_save_code, cached_reg_restore_code): Redefine as macros. From-SVN: r162106
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/caller-save.c15
-rw-r--r--gcc/reload.h8
3 files changed, 19 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index be54183..e2a9f8e 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,12 @@
2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+ * reload.h (target_reload): Add x_cached_reg_save_code and
+ x_cached_reg_restore_code.
+ * caller-save.c (cached_reg_save_code, cached_reg_restore_code):
+ Redefine as macros.
+
+2010-07-12 Richard Sandiford <rdsandiford@googlemail.com>
+
* Makefile.in (target-globals.o): Depend on builtins.h.
* builtins.h: New file.
* builtins.c: Include builtins.h.
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index 3bd41f2..d95e66c 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -45,6 +45,10 @@ along with GCC; see the file COPYING3. If not see
#define regno_save_mode \
(this_target_reload->x_regno_save_mode)
+#define cached_reg_save_code \
+ (this_target_reload->x_cached_reg_save_code)
+#define cached_reg_restore_code \
+ (this_target_reload->x_cached_reg_restore_code)
/* For each hard register, a place on the stack where it can be saved,
if needed. */
@@ -58,17 +62,6 @@ static int save_slots_num;
/* Allocated slots so far. */
static rtx save_slots[FIRST_PSEUDO_REGISTER];
-/* We will only make a register eligible for caller-save if it can be
- saved in its widest mode with a simple SET insn as long as the memory
- address is valid. We record the INSN_CODE is those insns here since
- when we emit them, the addresses might not be valid, so they might not
- be recognized. */
-
-static int
- cached_reg_save_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
-static int
- cached_reg_restore_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
-
/* Set of hard regs currently residing in save area (during insn scan). */
static HARD_REG_SET hard_regs_saved;
diff --git a/gcc/reload.h b/gcc/reload.h
index 16d52d9..01bbfb1 100644
--- a/gcc/reload.h
+++ b/gcc/reload.h
@@ -182,6 +182,14 @@ struct target_reload {
enum machine_mode (x_regno_save_mode
[FIRST_PSEUDO_REGISTER]
[MAX_MOVE_MAX / MIN_UNITS_PER_WORD + 1]);
+
+ /* We will only make a register eligible for caller-save if it can be
+ saved in its widest mode with a simple SET insn as long as the memory
+ address is valid. We record the INSN_CODE is those insns here since
+ when we emit them, the addresses might not be valid, so they might not
+ be recognized. */
+ int x_cached_reg_save_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
+ int x_cached_reg_restore_code[FIRST_PSEUDO_REGISTER][MAX_MACHINE_MODE];
};
extern struct target_reload default_target_reload;