diff options
author | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-22 08:55:49 +0000 |
---|---|---|
committer | law <law@138bc75d-0d04-0410-961f-82ee72b054a4> | 1997-12-22 08:55:49 +0000 |
commit | 0c1173c49b26947e90e0b95544f91aa726279eb0 (patch) | |
tree | 1adccd06465441c3df1e33d4d90f4aa01b6071f5 | |
parent | 68b497b47490eff7915d71efc6fbebe910cf5fa1 (diff) | |
download | gcc-0c1173c49b26947e90e0b95544f91aa726279eb0.tar.gz |
* haifa-sched.c (create_reg_dead_note): Detect and handle another
case where we kill more regs after sched than were killed before
sched.
* sched.c (create_reg_dead_note): Similarly.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@17183 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/haifa-sched.c | 17 | ||||
-rw-r--r-- | gcc/sched.c | 6 |
2 files changed, 23 insertions, 0 deletions
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index b2545a2ace7..02350e1941f 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -4467,6 +4467,23 @@ create_reg_dead_note (reg, insn) while (reg_note_regs < regs_killed) { link = XEXP (link, 1); + + /* LINK might be zero if we killed more registers after scheduling + than before, and the last hard register we kill is actually + multiple hard regs. + + This is normal for interblock scheduling, so deal with it in + that case, else abort. */ + if (link == NULL_RTX && current_nr_blocks <= 1) + abort (); + else if (link == NULL_RTX) + { + link = rtx_alloc (EXPR_LIST); + PUT_REG_NOTE_KIND (link, REG_DEAD); + XEXP (link, 0) = gen_rtx (REG, word_mode, 0); + XEXP (link, 1) = NULL_RTX; + } + reg_note_regs += (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1 : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)), GET_MODE (XEXP (link, 0)))); diff --git a/gcc/sched.c b/gcc/sched.c index b7aa75de1eb..64b785f9533 100644 --- a/gcc/sched.c +++ b/gcc/sched.c @@ -2218,6 +2218,12 @@ create_reg_dead_note (reg, insn) GET_MODE (XEXP (link, 0)))); while (reg_note_regs < regs_killed) { + /* LINK might be zero if we killed more registers after scheduling + than before, and the last hard register we kill is actually + multiple hard regs. */ + if (link == NULL_RTX) + abort (); + link = XEXP (link, 1); reg_note_regs += (REGNO (XEXP (link, 0)) >= FIRST_PSEUDO_REGISTER ? 1 : HARD_REGNO_NREGS (REGNO (XEXP (link, 0)), |