From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jeffrey A Law To: egcs@cygnus.com Subject: Re: Some Haifa scheduler bugs Date: Fri, 22 Aug 1997 15:24:57 -0000 Message-ID: <9708221140.AA11211@issan.informatik.uni-dortmund.de> In-reply-to: Some Haifa scheduler bugs X-SW-Source: 1997-08/0295.html Message-ID: <19970822152457.JKIuT_nXaLew60nxHSI6wk2splchNSJbKXD-_2BpLJ0@z> In message you write: > I've thought about something like this, but this code won't work, I think. > It will call reemit_notes twice for the last insn in the SCHED_GROUP and > not at all for the first one. OK. Let's use the same example again: 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 (C) == 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) reemit_notes (Z, Z) So the problem here is we don't call reemit_notes for A B & C. So, how about this: static rtx move_insn (insn, last) rtx insn, last; { while (SCHED_GROUP_P (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); } insn = C We start the while loop (SCHED_GROUP_P (C) == 1) prev = B move_insn1 (C, last) reemit_notes (C, C) insn = B 2nd iteration (SCHED_GROUP_P (B) == 1) prev = A move_insn1 (B, last) reemit_notes (B, B) insn = A 3rd iteration (SCHED_GROUP_P (A) == 1) prev = Z move_insn1 (A, last) reemit_notes (A, A) insn = Z loop terminates (SCHED_GROUP_P (Z) == 0) move_insn1 (Z, last) reemit_notes (Z, Z) Jeff