diff options
author | kkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-29 01:24:27 +0000 |
---|---|---|
committer | kkojima <kkojima@138bc75d-0d04-0410-961f-82ee72b054a4> | 2005-06-29 01:24:27 +0000 |
commit | edf54f2a2e8d02cf6b2a56d863e971bb480d60bc (patch) | |
tree | 6e5206234e2011fe87ca88acfe08dfbe38d900ca /gcc/integrate.c | |
parent | 2a165e7bfb330347cf62a01108dcd0b656dd9975 (diff) | |
download | gcc-edf54f2a2e8d02cf6b2a56d863e971bb480d60bc.tar.gz |
* target.h (gcc_target): New field allocate_initial_value.
* target-def.h (TARGET_ALLOCATE_INITIAL_VALUE): New macro.
(TARGET_INITIALIZER): Include it.
* integrate.c (allocate_initial_values): Use
targetm.allocate_initial_value.
* system.h: Poison ALLOCATE_INITIAL_VALUE.
* config/sh/sh-protos.h (sh_pr_n_sets): Delete.
* config/sh/sh.c (sh_pr_n_sets): Make it static.
(sh_allocate_initila_value): New function.
(TARGET_ALLOCATE_INITIAL_VALUE): Override default.
* config/sh/sh.h (ALLOCATE_INITIAL_VALUE): Delete.
* doc/tm.texi (TARGET_ALLOCATE_INITIAL_VALUE): Rename and
update from ALLOCATE_INITIAL_VALUE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@101411 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/integrate.c')
-rw-r--r-- | gcc/integrate.c | 67 |
1 files changed, 35 insertions, 32 deletions
diff --git a/gcc/integrate.c b/gcc/integrate.c index bacba73c5fc..28da1157855 100644 --- a/gcc/integrate.c +++ b/gcc/integrate.c @@ -376,47 +376,50 @@ emit_initial_value_sets (void) void allocate_initial_values (rtx *reg_equiv_memory_loc ATTRIBUTE_UNUSED) { -#ifdef ALLOCATE_INITIAL_VALUE - struct initial_value_struct *ivs = cfun->hard_reg_initial_vals; - int i; - - if (ivs == 0) - return; - - for (i = 0; i < ivs->num_entries; i++) + if (targetm.allocate_initial_value) { - int regno = REGNO (ivs->entries[i].pseudo); - rtx x = ALLOCATE_INITIAL_VALUE (ivs->entries[i].hard_reg); + struct initial_value_struct *ivs = cfun->hard_reg_initial_vals; + int i; - if (x && REG_N_SETS (REGNO (ivs->entries[i].pseudo)) <= 1) + if (ivs == 0) + return; + + for (i = 0; i < ivs->num_entries; i++) { - if (MEM_P (x)) - reg_equiv_memory_loc[regno] = x; - else + int regno = REGNO (ivs->entries[i].pseudo); + rtx x = targetm.allocate_initial_value (ivs->entries[i].hard_reg); + + if (x && REG_N_SETS (REGNO (ivs->entries[i].pseudo)) <= 1) { - basic_block bb; - int new_regno; - - gcc_assert (REG_P (x)); - new_regno = REGNO (x); - reg_renumber[regno] = new_regno; - /* Poke the regno right into regno_reg_rtx so that even - fixed regs are accepted. */ - REGNO (ivs->entries[i].pseudo) = new_regno; - /* Update global register liveness information. */ - FOR_EACH_BB (bb) + if (MEM_P (x)) + reg_equiv_memory_loc[regno] = x; + else { - struct rtl_bb_info *info = bb->il.rtl; - - if (REGNO_REG_SET_P(info->global_live_at_start, regno)) - SET_REGNO_REG_SET (info->global_live_at_start, new_regno); - if (REGNO_REG_SET_P(info->global_live_at_end, regno)) - SET_REGNO_REG_SET (info->global_live_at_end, new_regno); + basic_block bb; + int new_regno; + + gcc_assert (REG_P (x)); + new_regno = REGNO (x); + reg_renumber[regno] = new_regno; + /* Poke the regno right into regno_reg_rtx so that even + fixed regs are accepted. */ + REGNO (ivs->entries[i].pseudo) = new_regno; + /* Update global register liveness information. */ + FOR_EACH_BB (bb) + { + struct rtl_bb_info *info = bb->il.rtl; + + if (REGNO_REG_SET_P(info->global_live_at_start, regno)) + SET_REGNO_REG_SET (info->global_live_at_start, + new_regno); + if (REGNO_REG_SET_P(info->global_live_at_end, regno)) + SET_REGNO_REG_SET (info->global_live_at_end, + new_regno); + } } } } } -#endif } #include "gt-integrate.h" |