From patchwork Thu Dec 13 19:37:24 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [alpha] Fix dwarf2 call-arg-location ICE Date: Thu, 13 Dec 2012 09:37:24 -0000 From: Richard Henderson X-Patchwork-Id: 206207 Message-Id: <50CA2E74.2050908@redhat.com> To: GCC Patches Here's me wishing that NOTE_INSN_CALL_ARG_LOCATION was a reg note and not an insn note. Mainly because it's required to be adjacent to the call insn, modulo barriers apparently. This just started failing recently, though I didn't check to see what sort of other change might have precipitated this. Tested via cross to alphaev67-linux. r~ * config/alpha/alpha.c (alpha_pad_function_end): Consider barriers when looking for NOTE_INSN_CALL_ARG_LOCATION. diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 82135ff..8411218 100644 --- a/gcc/config/alpha/alpha.c +++ b/gcc/config/alpha/alpha.c @@ -9253,23 +9253,26 @@ alpha_pad_function_end (void) for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) { - if (! (CALL_P (insn) - && (SIBLING_CALL_P (insn) - || find_reg_note (insn, REG_NORETURN, NULL_RTX)))) + if (!CALL_P (insn) + || !(SIBLING_CALL_P (insn) + || find_reg_note (insn, REG_NORETURN, NULL_RTX))) continue; /* Make sure we do not split a call and its corresponding CALL_ARG_LOCATION note. */ - if (CALL_P (insn)) + next = NEXT_INSN (insn); + if (next == NULL) + continue; + if (BARRIER_P (next)) { - next = NEXT_INSN (insn); - if (next && NOTE_P (next) - && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION) - insn = next; + next = NEXT_INSN (next); + if (next == NULL) + continue; } + if (NOTE_P (next) && NOTE_KIND (next) == NOTE_INSN_CALL_ARG_LOCATION) + insn = next; next = next_active_insn (insn); - if (next) { rtx pat = PATTERN (next);