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
This commit is contained in:
John David Anglin 2004-12-05 04:05:59 +00:00 committed by John David Anglin
parent 6ac5aa910e
commit 91373fe8f7
2 changed files with 38 additions and 4 deletions

View File

@ -1,5 +1,10 @@
2004-12-04 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
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.

View File

@ -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;
}