From: John David Anglin Date: Sun, 5 Dec 2004 04:05:59 +0000 (+0000) Subject: re PR middle-end/18730 (cppexp.c:1076: error: unrecognizable insn) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=91373fe8f7f94b846d06ada9bd3766b694eebc4f;p=gcc.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: r91742 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3e609a37c23..e889dbc82e8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2004-12-04 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. + PR bootstrap/18804 * mklibgcc.in (vis_hide): Use implementation instead of declaration for test function. diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c index 6858f987ad6..793e2df8da4 100644 --- a/gcc/emit-rtl.c +++ b/gcc/emit-rtl.c @@ -2712,9 +2712,23 @@ get_last_insn_anywhere (void) rtx get_first_nonnote_insn (void) { - 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; } @@ -2724,9 +2738,24 @@ get_first_nonnote_insn (void) rtx get_last_nonnote_insn (void) { - 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; }