From: Jeff Law Date: Mon, 22 Dec 1997 08:55:43 +0000 (-0700) Subject: haifa-sched.c (create_reg_dead_note): Detect and handle another case where we kill... X-Git-Tag: prereleases/egcs-1.0.1-prerelease~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8cf3875bbc4bfac9a14375c3001d7c442b2a7b6f;p=thirdparty%2Fgcc.git haifa-sched.c (create_reg_dead_note): Detect and handle another case where we kill more regs after sched than were... * 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. [[Split portion of a mixed commit.]] From-SVN: r17182.1 --- diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index 59a1190ccb04..706e585490b3 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -4462,6 +4462,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 b81532425742..6e9f95645c62 100644 --- a/gcc/sched.c +++ b/gcc/sched.c @@ -2208,6 +2208,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)),