aboutsummaryrefslogtreecommitdiff
path: root/gcc/global.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/global.c')
-rw-r--r--gcc/global.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/gcc/global.c b/gcc/global.c
index 471e42e8fd9..0840b87b191 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -130,6 +130,11 @@ struct allocno
/* Set of hard registers that some later allocno has a preference for. */
HARD_REG_SET regs_someone_prefers;
+
+#ifdef STACK_REGS
+ /* Set to true if allocno can't be allocated in the stack register. */
+ bool no_stack_reg;
+#endif
};
static struct allocno *allocno;
@@ -706,8 +711,14 @@ global_conflicts ()
if (e->flags & EDGE_ABNORMAL)
break;
if (e != NULL)
- for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
- record_one_conflict (ax);
+ {
+ EXECUTE_IF_SET_IN_ALLOCNO_SET (allocnos_live, ax,
+ {
+ allocno[ax].no_stack_reg = 1;
+ });
+ for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
+ record_one_conflict (ax);
+ }
}
#endif
}
@@ -1204,6 +1215,10 @@ find_reg (num, losers, alt_regs_p, accept_call_clobbered, retrying)
&& ! invalid_mode_change_p (regno, REGNO_REG_CLASS (regno),
mode)
#endif
+#ifdef STACK_REGS
+ && (!allocno[num].no_stack_reg
+ || regno < FIRST_STACK_REG || regno > LAST_STACK_REG)
+#endif
)
{
/* We explicitly evaluate the divide results into temporary