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]

[PATCH] haifa-sched: SCHED_GROUP_P ignored for queued insn


Hi,

(sorry for the last empty mail :(

a scheduler bug makes insns of different LIBCALL/RETVAL blocks to get
intermixed. 

If a SCHED_GROUP_P insn gets queued due to a pipeline hazard, the scheduler 
chooses an insn from the ready list without looking at the queued_list.
If an insn which belongs to a sched group is available either on the ready list
or on the queued list this insn has to be scheduled (according to the definition
of sched groups).
For insns queued due to data dependencies there is already a check 
(haifa-sched.c:952) which advances the cycle count so that the queued 
sched group insn comes to the ready list in the next turn and hence can 
be choosen by choose_insn.

The attached patch implements the same check for the other call of queue_insn
(haifa-sched.c:2054).

This fixes a testcase on s390x compiled with -O2, -m31 and -march=z990. Unfortunately
the testcase is extremely vulnerable to compiler changes and therefore not 
appropriate for the testsuite.

Bootstrapped and regtested on s390, s390x and i686.

OK? Please commit at mainline if so.

Bye,

-Andreas-

2005-02-08  Andreas Krebbel  <krebbel1@de.ibm.com>

	* gcc/haifa-sched.c (schedule_block): Make queued sched group 
	insns return to ready list in the next turn.


Index: gcc/haifa-sched.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/haifa-sched.c,v
retrieving revision 1.251
diff -p -c -r1.251 haifa-sched.c
*** gcc/haifa-sched.c	24 Nov 2004 11:32:22 -0000	1.251
--- gcc/haifa-sched.c	8 Feb 2005 07:16:10 -0000
*************** schedule_block (int b, int rgn_n_insns)
*** 2052,2057 ****
--- 2052,2063 ----
  	  if (cost >= 1)
  	    {
  	      queue_insn (insn, cost);
+ 	      if (SCHED_GROUP_P (insn))
+ 		{
+ 		  advance = cost;
+ 		  break;
+ 		}
+ 
  	      continue;
  	    }
  


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