http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52287
--- Comment #9 from Bernd Schmidt <bernds at gcc dot gnu.org> 2012-02-23 15:41:49 UTC --- (In reply to comment #8) > This reproduces only on Solaris 8 because the sort of the ready list isn't > stable in the presence of debug insns, given that rank_for_schedule isn't > anti-symmetrical: Thanks for investigating this. > Index: haifa-sched.c > =================================================================== > --- haifa-sched.c (revision 184352) > +++ haifa-sched.c (working copy) > @@ -1647,7 +1647,7 @@ rank_for_schedule (const void *x, const > /* Schedule debug insns as early as possible. */ > if (DEBUG_INSN_P (tmp) && !DEBUG_INSN_P (tmp2)) > return -1; > - else if (DEBUG_INSN_P (tmp2)) > + else if (DEBUG_INSN_P (tmp2) && !DEBUG_INSN_P (tmp)) > return 1; > } > > as it makes the sort stable and equivalent to the non-Solaris 8 case. Almost OK, but in the case of two debug insns, can you make it return the difference of the INSN_UIDs here? I'd rather not fall through into the other code for DEBUG_INSNs. Such a patch is preapproved.
