diff options
author | Jeff Law <law@gcc.gnu.org> | 1995-12-31 19:32:57 -0700 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1995-12-31 19:32:57 -0700 |
commit | 6cad67d2d0789487217a2091c2f14d48f9e1ad6b (patch) | |
tree | 6954fbd4d8694312315db4ec5b21e6a62873aec7 /gcc/local-alloc.c | |
parent | 6e81958a66749a62fdd4f50de26e52a10fa559da (diff) | |
download | gcc-6cad67d2d0789487217a2091c2f14d48f9e1ad6b.zip gcc-6cad67d2d0789487217a2091c2f14d48f9e1ad6b.tar.gz gcc-6cad67d2d0789487217a2091c2f14d48f9e1ad6b.tar.bz2 |
hard-reg-set.h (losing_caller_save_reg_set): Declare.
* hard-reg-set.h (losing_caller_save_reg_set): Declare.
* regclass.c (losing_caller_save_reg_set): Define.
(init_reg_sets_1): Initialize losing_caller_save_reg_set.
* global.c (find_reg): Avoid caller-saving registers in
LOSING_CALLER_SAVE_REGS if it's defined.
* local-alloc.c (find_free_reg): Avoid caller-saving registers
in losing_caller_save_reg_set.
(CLASS_LIKELY_SPILLED_P): Delete definition. Moved into regs.h.
* regs.h (CLASS_LIKELY_SPILLED_P): Define if not already defined.
From-SVN: r10926
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r-- | gcc/local-alloc.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c index 9d941fe..20bcc1c 100644 --- a/gcc/local-alloc.c +++ b/gcc/local-alloc.c @@ -55,6 +55,10 @@ Boston, MA 02111-1307, USA. */ But this is currently disabled since tying in global_alloc is not yet implemented. */ +/* Pseudos allocated here cannot be reallocated by global.c if the hard + register is used as a spill register. So we don't allocate such pseudos + here if their preferred class is likely to be used by spills. */ + #include <stdio.h> #include "config.h" #include "rtl.h" @@ -66,17 +70,6 @@ Boston, MA 02111-1307, USA. */ #include "recog.h" #include "output.h" -/* Pseudos allocated here cannot be reallocated by global.c if the hard - register is used as a spill register. So we don't allocate such pseudos - here if their preferred class is likely to be used by spills. - - On most machines, the appropriate test is if the class has one - register, so we default to that. */ - -#ifndef CLASS_LIKELY_SPILLED_P -#define CLASS_LIKELY_SPILLED_P(CLASS) (reg_class_size[(int) (CLASS)] == 1) -#endif - /* Next quantity number available for allocation. */ static int next_qty; @@ -2106,6 +2099,9 @@ find_free_reg (class, mode, qty, accept_call_clobbered, just_try_suggested, else COPY_HARD_REG_SET (used, call_used_reg_set); + if (accept_call_clobbered) + IOR_HARD_REG_SET(used, losing_caller_save_reg_set); + for (ins = born_index; ins < dead_index; ins++) IOR_HARD_REG_SET (used, regs_live_at[ins]); |