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: "bernds 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:41:49 +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 #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.