This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix ICE after sel-sched merge


Eric Botcazou writes:
> OK with the following modifications:
> [...]

Thanks very much, Eric.  This is what I've checked in after bootstrapping and
regtesting on mips64octeon-linux-gnu along with the pipeline patch that had
originally triggered the bug.  It's r140444.

2008-09-17  Adam Nemet  <anemet@caviumnetworks.com>

	* haifa-sched.c (dep_cost_1): Recognize the producer even if the
	consumer is an asm.  Add comment why this is important.
	(choose_ready): Add comment to the "INSN_CODE (insn) >= 0 ||
	recog_memoized (insn) < 0" assert.  Put ENABLE_CHECKING around
	it.

Index: gcc/haifa-sched.c
===================================================================
--- gcc.orig/haifa-sched.c	2008-09-15 11:12:17.000000000 -0700
+++ gcc/haifa-sched.c	2008-09-17 12:05:44.000000000 -0700
@@ -646,10 +646,12 @@ insn_cost (rtx insn)
 
 /* Compute cost of dependence LINK.
    This is the number of cycles between instruction issue and
-   instruction results.  */
+   instruction results.
+   ??? We also use this function to call recog_memoized on all insns.  */
 int
 dep_cost_1 (dep_t link, dw_t dw)
 {
+  rtx insn = DEP_PRO (link);
   rtx used = DEP_CON (link);
   int cost;
 
@@ -657,10 +659,12 @@ dep_cost_1 (dep_t link, dw_t dw)
      This allows the computation of a function's result and parameter
      values to overlap the return and call.  */
   if (recog_memoized (used) < 0)
-    cost = 0;
+    {
+      cost = 0;
+      recog_memoized (insn);
+    }
   else
     {
-      rtx insn = DEP_PRO (link);
       enum reg_note dep_type = DEP_TYPE (link);
 
       cost = insn_cost (insn);
@@ -2312,8 +2316,14 @@ choose_ready (struct ready_list *ready, 
 	  {
 	    insn = ready_element (ready, i);
 
+#ifdef ENABLE_CHECKING
+	    /* If this insn is recognizable we should have already
+	       recognized it earlier.
+	       ??? Not very clear where this is supposed to be done.
+	       See dep_cost_1.  */
 	    gcc_assert (INSN_CODE (insn) >= 0
 			|| recog_memoized (insn) < 0);
+#endif
 
 	    ready_try [i]
 	      = (/* INSN_CODE check can be omitted here as it is also done later


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]