This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix SCHED_GROUP_P ICEs on v850


Roger Sayle wrote:

> The following patch fixes two ICEs building mainline GCC on v850.
> Both occur building libstdc++-v3/include/bits/istream.tcc:
>
> internal compiler error: RTL flag check: SCHED_GROUP_P used with
> unexpected rtx code `note' in can_schedule_ready_p, at sched-rgn.c:2123
>
> The code in question looks like:
>
> >       while (SCHED_GROUP_P (insn))
> >         insn = PREV_INSN (insn);
>
> Examining the other examples of looping over SCHED_GROUP_P in
> sched-rgn.c, it appears the correct fix it to use prev_nonnote_insn.
> Making this change, gets us very slightly further:
>
> internal compiler error: RTL flag check: SCHED_GROUP_P used with
> unexpected rtx code `note' in move_insn, at haifa-sched.c:1774
>
> This is an identical problem, and can be resolved using the same
> idiom, replacing PREV_INSN with prev_nonnote_insn.
>
> With these two changes I'm able to successfully build a cross-compiler
> from i686-pc-linux-gnu to v850-elf, and run the testsuite on v850-sim.
> The patch has also been tested with a complete bootstrap, all languages
> except Ada and treelang, on i686-pc-linux-gnu, and a full "make -k check"
> with no new regressions.
>

  I think there is no big harm from the patch.  We can only lose a note (it
might be serious or not, at least it is less serious than the ice).  The
scheduler removes notes before scheduling a block.  There should be no notes
at this stage but they are present.  So the bug is in something else.
I suspect that when we move insn from one block to another, the block being
scheduled has no notes but the block from which the insn is moved has
notes.  This is a design flaw.  It can not be easy solved.

Vlad



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]