From: John David Anglin Date: Tue, 14 Dec 2004 04:06:08 +0000 (+0000) Subject: re PR middle-end/18730 (cppexp.c:1076: error: unrecognizable insn) X-Git-Tag: releases/gcc-3.3.6~185 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c120e14d100d4619ea030c9a07966c6c6d78e99b;p=thirdparty%2Fgcc.git re PR middle-end/18730 (cppexp.c:1076: error: unrecognizable insn) PR middle-end/18730 * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): When the first/last insn is a sequence, return the first/last insn of the sequence. From-SVN: r92126 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 915137d8144c..5cc4be30cc90 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2004-12-13 John David Anglin + + PR middle-end/18730 + * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn): When + the first/last insn is a sequence, return the first/last insn of the + sequence. + 2004-12-12 Richard Henderson PR target/18932 diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index a41d00a91201..b674ac2eee75 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2888,9 +2888,23 @@ get_last_insn_anywhere () rtx get_first_nonnote_insn () { - rtx insn; + rtx insn = first_insn; + + if (insn) + { + if (NOTE_P (insn)) + for (insn = next_insn (insn); + insn && NOTE_P (insn); + insn = next_insn (insn)) + continue; + else + { + if (GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == SEQUENCE) + insn = XVECEXP (PATTERN (insn), 0, 0); + } + } - for (insn = first_insn; insn && NOTE_P (insn); insn = next_insn (insn)); return insn; } @@ -2900,9 +2914,24 @@ get_first_nonnote_insn () rtx get_last_nonnote_insn () { - rtx insn; + rtx insn = last_insn; + + if (insn) + { + if (NOTE_P (insn)) + for (insn = previous_insn (insn); + insn && NOTE_P (insn); + insn = previous_insn (insn)) + continue; + else + { + if (GET_CODE (insn) == INSN + && GET_CODE (PATTERN (insn)) == SEQUENCE) + insn = XVECEXP (PATTERN (insn), 0, + XVECLEN (PATTERN (insn), 0) - 1); + } + } - for (insn = last_insn; insn && NOTE_P (insn); insn = previous_insn (insn)); return insn; }