public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Bernd Schmidt <crux@Pool.Informatik.RWTH-Aachen.DE>
To: egcs@cygnus.com
Subject: Re: Some Haifa scheduler bugs
Date: Fri, 22 Aug 1997 13:28:34 -0000	[thread overview]
Message-ID: <199708221048.MAA01066@waldorf.appli.se> (raw)
Message-ID: <19970822132834.wsaImkjRozuWvW5geX6AqWyF2y6YzdzIyAc6xLCZkVg@z> (raw)
In-Reply-To: 23234.872185439@hurl.cygnus.com

> 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

             reply	other threads:[~1997-08-22 13:28 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-22 10:48 Niklas Hallqvist [this message]
1997-08-22 13:28 ` Bernd Schmidt
1997-08-22 13:53 ` reload_cse_regs improvement Bernd Schmidt
1997-08-22 13:53 ` Probable bug in gcc/reg-stack.c (example given) Bernd Schmidt
  -- strict thread matches above, loose matches on Subject: below --
1997-08-25 13:09 Building of generated parser files John Carr
1997-08-24 16:08 egcs-ss-970821 - Run-Time Library Cross Problems Joel Sherrill
1997-08-24 16:08 ` Building of generated parser files Niklas Hallqvist
1997-08-24  3:43 Jim Meyering
1997-08-24  3:43 new gcc configure question Joel Sherrill
1997-08-24  3:43 ` Building of generated parser files Richard Stallman
1997-08-24  3:43 Fergus Henderson
1997-08-24  3:43 Ian Lance Taylor
1997-08-24  3:43 Richard Stallman
1997-08-24  3:43 David Bristow
1997-08-24  3:43 Joel Sherrill
1997-08-24  3:43 ` Ian Lance Taylor
1997-08-24  3:43 Jim Wilson
1997-08-24  3:43 egcs has some bad optimization bug H.J. Lu
1997-08-24  3:43 ` Building of generated parser files Tom Tromey
1997-08-24  3:43 Richard Henderson
1997-08-23 14:31 Ian Lance Taylor
1997-08-23 12:44 Niklas Hallqvist
1997-08-22 15:53 Ian Lance Taylor
1997-08-22 13:53 Andreas Schwab
1997-08-22  7:09 Niklas Hallqvist
1997-08-21 23:46 Jim Wilson
1997-08-21 20:43 Per Bothner
1997-08-21 20:42 meissner
1997-08-21 20:42 Joern Rennecke
1997-08-21 19:23 Michael Meissner
1997-08-21 19:23 meissner
1997-08-21 19:23 Fred Fish

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199708221048.MAA01066@waldorf.appli.se \
    --to=crux@pool.informatik.rwth-aachen.de \
    --cc=egcs@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).