summaryrefslogtreecommitdiff
path: root/gcc/local-alloc.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1996-01-01 02:32:57 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1996-01-01 02:32:57 +0000
commit2836f00621a6b05ba7f9ed67a531a56cc73b3682 (patch)
tree6954fbd4d8694312315db4ec5b21e6a62873aec7 /gcc/local-alloc.c
parent45ca31d6f4658b3f17900c84982602ec3baaeab1 (diff)
downloadgcc-2836f00621a6b05ba7f9ed67a531a56cc73b3682.tar.gz
* 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@10926 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/local-alloc.c')
-rw-r--r--gcc/local-alloc.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 9d941fef162..20bcc1cc4b5 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]);