http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52287
--- Comment #8 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2012-02-23 15:23:44 UTC --- 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: if (MAY_HAVE_DEBUG_INSNS) { /* Schedule debug insns as early as possible. */ if (DEBUG_INSN_P (tmp) && !DEBUG_INSN_P (tmp2)) return -1; else if (DEBUG_INSN_P (tmp2)) return 1; } The following patchlet is enough to get rid of the ICE: 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.