From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernd Schmidt To: egcs@cygnus.com Subject: Re: Some Haifa scheduler bugs Date: Fri, 22 Aug 1997 13:28:34 -0000 Message-ID: <199708221048.MAA01066@waldorf.appli.se> In-reply-to: 23234.872185439@hurl.cygnus.com X-SW-Source: 1997-08/0289.html Message-ID: <19970822132834.wsaImkjRozuWvW5geX6AqWyF2y6YzdzIyAc6xLCZkVg@z> > Good point. However, the more I look at that SCHED_GROUP_P loop, > the more I think it must be broken. > > Consider if we have Z <-A <-B <-C, all with SCHED_GROUP_P set on A B & C, > but not Z. > > insn = C > We start the while loop (SCHED_GROUP_P (A) == 1) > prev = B > move_insn1 (C, last) > insn = B > 2nd iteration (SCHED_GROUP_P (B) == 1) > prev = A > move_insn1 (B, last) > insn = A > 3rd iteration (SCHED_GROUP_P (A) == 1) > prev = Z > move_insn_1 (A, last) > insn = Z > loop terminates (SCHED_GROUP_P (Z) == 0) > > move_insn1 (Z, last) > > > So we end up moving one insn more than we should right? No. `SCHED_GROUP_P (INSN)' During instruction scheduling, in an insn, indicates that the previous insn must be scheduled together with this insn. This is used to ensure that certain groups of instructions will not be split up by the instruction scheduling pass, for example, `use' insns before a `call_insn' may not be separated from the `call_insn'. Stored in the `in_struct' field and printed as `/s'. This means that the first insn in a SCHED_GROUP doesn't have the SCHED_GROUP_P bit set, so Z _is_ supposed to be scheduled. The group consists of all four insns. > static rtx > move_insn (insn, last) > rtx insn, last; > { > > while (SCHED_GROUP_P (PREV_INSN (insn))) > { > rtx prev = PREV_INSN (insn); > move_insn1 (insn, last); > reemit_notes (insn, insn); > insn = prev; > } > > move_insn1 (insn, last); > return reemit_notes (insn, insn); > } Apart from what I said above, that might move insns that belong to a SCHED_GROUP that starts before insn. > Can you try it? Or give me the testcase that's currently failing > for you so that I can try it myself? I didn't make any notes, unfortunately. I can certainly try it, but I doubt it will work. I'll re-run c-torture with the unmodified scheduler and report all failures. Bernd