aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1993-05-14 14:16:34 -0700
committerJim Wilson <wilson@gcc.gnu.org>1993-05-14 14:16:34 -0700
commitf52152d6acbf1118835ce6832685d8da00074daf (patch)
tree265f9f8d78fdff8ef42a9bbe0344762e257ac114
parent65488bae3e420f9381fe2ff2b217317e1cf58509 (diff)
downloadgcc-f52152d6acbf1118835ce6832685d8da00074daf.zip
gcc-f52152d6acbf1118835ce6832685d8da00074daf.tar.gz
gcc-f52152d6acbf1118835ce6832685d8da00074daf.tar.bz2
(split_hard_reg_notes): Handle 0th sub register, and multiple register kills.
(split_hard_reg_notes): Handle 0th sub register, and multiple register kills. (update_flow_info): For multi-word hard regs, use split_hard_reg_notes to add all REG_DEAD notes, instead of just the additional ones due to splitting. From-SVN: r4460
-rw-r--r--gcc/sched.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/gcc/sched.c b/gcc/sched.c
index 434f768..1797d1c 100644
--- a/gcc/sched.c
+++ b/gcc/sched.c
@@ -3833,11 +3833,7 @@ split_hard_reg_notes (note, first, last, orig_insn)
n_regs = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
- /* ??? Could add check here to see whether, the hard register is referenced
- in the same mode as in the original insn. If so, then it has not been
- split, and the rest of the code below is unnecessary. */
-
- for (i = 1; i < n_regs; i++)
+ for (i = 0; i < n_regs; i++)
{
new_reg = REGNO (reg) + i;
@@ -3853,6 +3849,10 @@ split_hard_reg_notes (note, first, last, orig_insn)
XEXP (link, 0) = temp;
XEXP (link, 1) = REG_NOTES (insn);
REG_NOTES (insn) = link;
+
+ /* If killed multiple registers here, then add in the excess. */
+ i += HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)) - 1;
+
break;
}
/* It isn't mentioned anywhere, so no new reg note is needed for
@@ -4033,8 +4033,20 @@ update_flow_info (notes, first, last, orig_insn)
if (GET_RTX_CLASS (GET_CODE (insn)) == 'i'
&& reg_mentioned_p (XEXP (note, 0), PATTERN (insn)))
{
- XEXP (note, 1) = REG_NOTES (insn);
- REG_NOTES (insn) = note;
+ /* If this note refers to a multiple word hard register, it
+ may have been split into several smaller hard register
+ references, so handle it specially. */
+ temp = XEXP (note, 0);
+ if (REG_NOTE_KIND (note) == REG_DEAD
+ && GET_CODE (temp) == REG
+ && REGNO (temp) < FIRST_PSEUDO_REGISTER
+ && HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)) > 1)
+ split_hard_reg_notes (note, first, last, orig_insn);
+ else
+ {
+ XEXP (note, 1) = REG_NOTES (insn);
+ REG_NOTES (insn) = note;
+ }
/* Sometimes need to convert REG_UNUSED notes to REG_DEAD
notes. */
@@ -4061,17 +4073,6 @@ update_flow_info (notes, first, last, orig_insn)
break;
}
}
-
- /* If this note refers to a multiple word hard register, it may
- have been split into several smaller hard register references.
- Check to see if there are any new register references that
- need REG_NOTES added for them. */
- temp = XEXP (note, 0);
- if (REG_NOTE_KIND (note) == REG_DEAD
- && GET_CODE (temp) == REG
- && REGNO (temp) < FIRST_PSEUDO_REGISTER
- && HARD_REGNO_NREGS (REGNO (temp), GET_MODE (temp)))
- split_hard_reg_notes (note, first, last, orig_insn);
break;
case REG_WAS_0: