Patchwork Fix PR bootstrap/52287

login
register
mail settings
Submitter Eric Botcazou
Date Feb. 23, 2012, 10:16 p.m.
Message ID <201202232316.06309.ebotcazou@adacore.com>
Download mbox | patch
Permalink /patch/142721/
State New
Headers show

Comments

Eric Botcazou - Feb. 23, 2012, 10:16 p.m.
This fixes the recent bootstrap failure of the mainline on SPARC/Solaris 8 by 
stabilizing the sort of the ready list of the Haïfa scheduler in the presence 
of debug insns.

Bootstrapped/regtested on SPARC/Solaris 8 and x86-64/Linux, pre-approved by 
Bernd, applied on the mainline.


2012-02-23  Eric Botcazou  <ebotcazou@adacore.com>

	PR bootstrap/52287
	* haifa-sched.c (rank_for_schedule): Stabilize sort for debug insns.

Patch

Index: haifa-sched.c
===================================================================
--- haifa-sched.c	(revision 184352)
+++ haifa-sched.c	(working copy)
@@ -1647,8 +1647,10 @@  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 (tmp) && DEBUG_INSN_P (tmp2))
 	return 1;
+      else if (DEBUG_INSN_P (tmp) && DEBUG_INSN_P (tmp2))
+	return INSN_LUID (tmp) - INSN_LUID (tmp2);
     }
 
   /* The insn in a schedule group should be issued the first.  */