This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/52287] [4.7 regression] ICE in ready_remove_first, at haifa-sched.c:1927
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Feb 2012 15:23:44 +0000
- Subject: [Bug bootstrap/52287] [4.7 regression] ICE in ready_remove_first, at haifa-sched.c:1927
- Auto-submitted: auto-generated
- References: <bug-52287-4@http.gcc.gnu.org/bugzilla/>
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.