summaryrefslogtreecommitdiff
path: root/gcc/global.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-14 21:51:07 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2003-04-14 21:51:07 +0000
commitabecbfc664cce98005dd0dc168a2e30196e1ddf8 (patch)
treeac2b435b1226bd9d87e98bbeba76fed3478b54f1 /gcc/global.c
parent65a517ff34b4c66828b4890edae535cd3072ef78 (diff)
downloadgcc-abecbfc664cce98005dd0dc168a2e30196e1ddf8.tar.gz
* global.c (global_conflicts): Prevent allocation of call clobbered
hard regs to pseudos live across abnormal edges, as later passes are not ready to handle them. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@65597 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/global.c')
-rw-r--r--gcc/global.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/gcc/global.c b/gcc/global.c
index b35777ee6d6..d5636084ce7 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -703,26 +703,38 @@ global_conflicts ()
scan the instruction that makes either X or Y become live. */
record_conflicts (block_start_allocnos, ax);
-#ifdef STACK_REGS
+ /* Pseudos can't go in stack regs at the start of a basic block that
+ is reached by an abnormal edge. Likewise for call clobbered regs,
+ because because caller-save, fixup_abnormal_edges, and possibly
+ the table driven EH machinery are not quite ready to handle such
+ regs live across such edges. */
{
- /* Pseudos can't go in stack regs at the start of a basic block
- that is reached by an abnormal edge. */
-
edge e;
+
for (e = b->pred; e ; e = e->pred_next)
if (e->flags & EDGE_ABNORMAL)
break;
+
if (e != NULL)
{
+#ifdef STACK_REGS
EXECUTE_IF_SET_IN_ALLOCNO_SET (allocnos_live, ax,
- {
- allocno[ax].no_stack_reg = 1;
- });
+ {
+ allocno[ax].no_stack_reg = 1;
+ });
for (ax = FIRST_STACK_REG; ax <= LAST_STACK_REG; ax++)
record_one_conflict (ax);
+#endif
+
+ /* No need to record conflicts for call clobbered regs if we have
+ nonlocal labels around, as we don't ever try to allocate such
+ regs in this case. */
+ if (! current_function_has_nonlocal_label)
+ for (ax = 0; ax < FIRST_PSEUDO_REGISTER; ax++)
+ if (call_used_regs [ax])
+ record_one_conflict (ax);
}
}
-#endif
}
insn = b->head;