aboutsummaryrefslogtreecommitdiff
path: root/gcc/reload1.c
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1998-05-05 17:18:02 -0600
committerJeff Law <law@gcc.gnu.org>1998-05-05 17:18:02 -0600
commitf5963e617044e79f7658c82ebc9acdccdc56d57b (patch)
tree017db6c8be411c52ab98093e94dcce3c7ca3f029 /gcc/reload1.c
parent9d1bcb4667cf94ae02b3b3015694a55175be9c9f (diff)
downloadgcc-f5963e617044e79f7658c82ebc9acdccdc56d57b.zip
gcc-f5963e617044e79f7658c82ebc9acdccdc56d57b.tar.gz
gcc-f5963e617044e79f7658c82ebc9acdccdc56d57b.tar.bz2
* Check in merge from gcc2. See ChangeLog.12 for details.
From-SVN: r19553
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r--gcc/reload1.c56
1 files changed, 15 insertions, 41 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c
index c8fb2ef..c9ebee9 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -1,5 +1,5 @@
/* Reload pseudo regs into hard regs for insns that require hard regs.
- Copyright (C) 1987, 88, 89, 92-7 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -378,7 +378,6 @@ static void clear_reload_reg_in_use PROTO((int, int, enum reload_type,
static int reload_reg_free_p PROTO((int, int, enum reload_type));
static int reload_reg_free_before_p PROTO((int, int, enum reload_type));
static int reload_reg_reaches_end_p PROTO((int, int, enum reload_type));
-static int reloads_conflict PROTO((int, int));
static int allocate_reload_reg PROTO((int, rtx, int, int));
static void choose_reload_regs PROTO((rtx, rtx));
static void merge_assigned_reloads PROTO((rtx));
@@ -1165,7 +1164,6 @@ reload (first, global, dumpfile)
enum reg_class class = reload_reg_class[i];
int size;
enum machine_mode mode;
- int nongroup_need;
struct needs *this_needs;
/* Don't count the dummy reloads, for which one of the
@@ -1193,31 +1191,6 @@ reload (first, global, dumpfile)
mode = reload_outmode[i];
size = CLASS_MAX_NREGS (class, mode);
- /* If this class doesn't want a group, determine if we have
- a nongroup need or a regular need. We have a nongroup
- need if this reload conflicts with a group reload whose
- class intersects with this reload's class. */
-
- nongroup_need = 0;
- if (size == 1)
- for (j = 0; j < n_reloads; j++)
- if ((CLASS_MAX_NREGS (reload_reg_class[j],
- (GET_MODE_SIZE (reload_outmode[j])
- > GET_MODE_SIZE (reload_inmode[j]))
- ? reload_outmode[j]
- : reload_inmode[j])
- > 1)
- && (!reload_optional[j])
- && (reload_in[j] != 0 || reload_out[j] != 0
- || reload_secondary_p[j])
- && reloads_conflict (i, j)
- && reg_classes_intersect_p (class,
- reload_reg_class[j]))
- {
- nongroup_need = 1;
- break;
- }
-
/* Decide which time-of-use to count this reload for. */
switch (reload_when_needed[i])
{
@@ -1295,10 +1268,10 @@ reload (first, global, dumpfile)
}
else if (size == 1)
{
- this_needs->regs[nongroup_need][(int) class] += 1;
+ this_needs->regs[reload_nongroup[i]][(int) class] += 1;
p = reg_class_superclasses[(int) class];
while (*p != LIM_REG_CLASSES)
- this_needs->regs[nongroup_need][(int) *p++] += 1;
+ this_needs->regs[reload_nongroup[i]][(int) *p++] += 1;
}
else
abort ();
@@ -1406,20 +1379,21 @@ reload (first, global, dumpfile)
if (GET_CODE (insn) == CALL_INSN
&& caller_save_spill_class != NO_REGS)
{
- /* See if this register would conflict with any reload
- that needs a group. */
+ /* See if this register would conflict with any reload that
+ needs a group or any reload that needs a nongroup. */
int nongroup_need = 0;
int *caller_save_needs;
for (j = 0; j < n_reloads; j++)
- if ((CLASS_MAX_NREGS (reload_reg_class[j],
- (GET_MODE_SIZE (reload_outmode[j])
- > GET_MODE_SIZE (reload_inmode[j]))
- ? reload_outmode[j]
- : reload_inmode[j])
- > 1)
- && reg_classes_intersect_p (caller_save_spill_class,
- reload_reg_class[j]))
+ if (reg_classes_intersect_p (caller_save_spill_class,
+ reload_reg_class[j])
+ && ((CLASS_MAX_NREGS
+ (reload_reg_class[j],
+ (GET_MODE_SIZE (reload_outmode[j])
+ > GET_MODE_SIZE (reload_inmode[j]))
+ ? reload_outmode[j] : reload_inmode[j])
+ > 1)
+ || reload_nongroup[j]))
{
nongroup_need = 1;
break;
@@ -4910,7 +4884,7 @@ reload_reg_reaches_end_p (regno, opnum, type)
This function uses the same algorithm as reload_reg_free_p above. */
-static int
+int
reloads_conflict (r1, r2)
int r1, r2;
{