public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/40101]  New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
@ 2009-05-11 14:08 rguenth at gcc dot gnu dot org
  2009-05-11 14:08 ` [Bug rtl-optimization/40101] " rguenth at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-11 14:08 UTC (permalink / raw)
  To: gcc-bugs

/gcc/spec/sb-terbium-head-64/ia64/install-200905081754/bin/gfortran -c -o
daten.o              -O3  daten.f
daten.f: In function 'daten':
daten.f:1850: internal compiler error: in get_seqno_by_preds, at
sel-sched-ir.c:3752
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

rev 147259 is good, rev 147290 is bad.


-- 
           Summary: [4.5 Regression] 200.sixtrack ICEs in
                    get_seqno_by_preds, at sel-sched-ir.c:3752
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
GCC target triplet: ia64-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
@ 2009-05-11 14:08 ` rguenth at gcc dot gnu dot org
  2009-05-14 14:13 ` abel at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-11 14:08 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
  2009-05-11 14:08 ` [Bug rtl-optimization/40101] " rguenth at gcc dot gnu dot org
@ 2009-05-14 14:13 ` abel at gcc dot gnu dot org
  2009-05-15 13:20 ` abel at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu dot org @ 2009-05-14 14:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from abel at gcc dot gnu dot org  2009-05-14 14:12 -------
Confirmed, I'll take a look.  (Somehow my ispras.ru account didn't get any
mails about this bug.)


-- 

abel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|abel at ispras dot ru       |abel at gcc dot gnu dot org
         AssignedTo|unassigned at gcc dot gnu   |abel at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2009-05-14 14:12:49
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
  2009-05-11 14:08 ` [Bug rtl-optimization/40101] " rguenth at gcc dot gnu dot org
  2009-05-14 14:13 ` abel at gcc dot gnu dot org
@ 2009-05-15 13:20 ` abel at gcc dot gnu dot org
  2009-05-21 10:53 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu dot org @ 2009-05-15 13:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from abel at gcc dot gnu dot org  2009-05-15 13:20 -------
The bug happens when we compute a seqno for the newly created bookkeping insn. 
Seqnos exist in the algorithm (roughly) to guide the movement of fences so
that, first, all unscheduled insns will be found and scheduled, and second,
"dynamic" back-edges during pipelining will be properly marked.  

The assert we hit just means that the existing code was unable to compute the
proper seqno, because it looks only on direct succs/preds of the place we want
to insert bookkeeping, yet in the test case the fences are processed in such an
order that all of those succs/preds are already scheduled (we're pipelining). 
The fix would be to extend this code to walk further to find yet unscheduled
insns and to derive the seqno from them.  

However, thinking about it further, I believe that we can get rid of seqnos
altogether.  We already have topological sorting for basic blocks in the
scheduler, and it should be enough just to check that we don't hit other fence
or already visited insn (or already scheduled insn if no pipelining) when
computing our availability sets, and it should be enough just to move fences to
unscheduled code.  The original approach also used seqnos to mark parallel
groups, but this is not needed for gcc.  So, as we are in Stage 1, and there is
no rush with this bug, I will try to get rid of seqnos first.  In case it turns
out I've overlooked anything, I will resort to the former, more conservative
fix.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2009-05-15 13:20 ` abel at gcc dot gnu dot org
@ 2009-05-21 10:53 ` rguenth at gcc dot gnu dot org
  2009-05-26 12:20 ` abel at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-05-21 10:53 UTC (permalink / raw)
  To: gcc-bugs



-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2009-05-21 10:53 ` rguenth at gcc dot gnu dot org
@ 2009-05-26 12:20 ` abel at gcc dot gnu dot org
  2009-05-29 15:33 ` abel at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu dot org @ 2009-05-26 12:20 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from abel at gcc dot gnu dot org  2009-05-26 12:19 -------
I have further looked at seqno handling, and it seems that we can't rip it off
without changing the region walking logic pretty much.  Seqnos are computed in
such a way that they mark the stage (the number of iteration of scheduling
loop) on which a parallel group of insns has been scheduled.  That is, if all
insns scheduled within the first iteration on fences will get #1, all insns
scheduled within the second iteration will get #2, this will be pretty much
equivalent.

Walking from higher to lower seqnos is prohibited, but not only to mark the
dynamic back-edge, but to forbid moving insns from "earlier" scheduling
iterations to "later" ones.  E.g., when pipelining, we can move insns from
stage #2 to #0 (yet unscheduled code), possibly through insns from stage #1,
but we cannot move insns from stage #1 to #0 through insns belonging to stage
#2.  

This logic is modeled by existing seqnos, so we cannot rip seqnos off without
changing the logic.  We can simplify it very slightly by making seqnos to be
plain iteration numbers like described above, but that would not allow removing
any code as I hoped.  We can also change this logic so that any movements from
scheduled to unscheduled code is possible for pipelining, but that would
require much more work and some tuning (I would probably try that later, but
not for this bug).

Thus, I would fix just the bug for now.  The fix is quite simple.  In the
situations like in the testcase, no positive seqnos around the bookkeeping insn
means that the fences will not be able to get to it.  This normally happens
during pipelining, though quite rare, so we have a code for this that would
pick up unscheduled bookkeeping and schedule it afterwards.  This logic will
deal with the test case, too.  We just need to assign pretty much arbitrary
positive seqno in this case.

So the following patch fixes the test case (it passes all SPECs) and bootstraps
on ia64 with sel-sched enabled at -O2, testing is in progress.  I will post it
to gcc-patches if the testing will look fine.


Index: gcc/sel-sched.c
===================================================================
*** gcc/sel-sched.c     (revision 147558)
--- gcc/sel-sched.c     (working copy)
*************** find_seqno_for_bookkeeping (insn_t place
*** 4524,4534 ****
    if (INSN_P (next)
        && JUMP_P (next)
        && BLOCK_FOR_INSN (next) == BLOCK_FOR_INSN (place_to_insert))
!     seqno = INSN_SEQNO (next);
    else if (INSN_SEQNO (join_point) > 0)
      seqno = INSN_SEQNO (join_point);
    else
!     seqno = get_seqno_by_preds (place_to_insert);

    gcc_assert (seqno > 0);
    return seqno;
--- 4524,4550 ----
    if (INSN_P (next)
        && JUMP_P (next)
        && BLOCK_FOR_INSN (next) == BLOCK_FOR_INSN (place_to_insert))
!     {
!       gcc_assert (INSN_SCHED_TIMES (next) == 0);
!       seqno = INSN_SEQNO (next);
!     }
    else if (INSN_SEQNO (join_point) > 0)
      seqno = INSN_SEQNO (join_point);
    else
!     {
!       seqno = get_seqno_by_preds (place_to_insert);
!
!       /* Sometimes the fences can move in such a way that there will be
!          no instructions with positive seqno around this bookkeeping.
!          This means that there will be no way to get to it by a regular
!          fence movement.  Never mind because we pick up such pieces for
!          rescheduling anyways, so any positive value will do for now.  */
!       if (seqno < 0)
!         {
!           gcc_assert (pipelining_p);
!           seqno = 42;
!         }
!     }

    gcc_assert (seqno > 0);
    return seqno;
Index: gcc/sel-sched-ir.c
===================================================================
*** gcc/sel-sched-ir.c  (revision 147558)
--- gcc/sel-sched-ir.c  (working copy)
*************** get_seqno_of_a_pred (insn_t insn)
*** 3730,3736 ****
    return seqno;
  }

! /*  Find the proper seqno for inserting at INSN.  */
  int
  get_seqno_by_preds (rtx insn)
  {
--- 3730,3737 ----
    return seqno;
  }

! /*  Find the proper seqno for inserting at INSN.  Returns -1 if no
predecessors
!     with positive seqno exist.  */
  int
  get_seqno_by_preds (rtx insn)
  {
*************** get_seqno_by_preds (rtx insn)
*** 3749,3755 ****
    for (i = 0, seqno = -1; i < n; i++)
      seqno = MAX (seqno, INSN_SEQNO (preds[i]));

-   gcc_assert (seqno > 0);
    return seqno;
  }

--- 3750,3755 ----


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2009-05-26 12:20 ` abel at gcc dot gnu dot org
@ 2009-05-29 15:33 ` abel at gcc dot gnu dot org
  2009-05-29 15:38 ` abel at gcc dot gnu dot org
  2010-08-24  8:51 ` abel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu dot org @ 2009-05-29 15:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from abel at gcc dot gnu dot org  2009-05-29 15:33 -------
Subject: Bug 40101

Author: abel
Date: Fri May 29 15:33:17 2009
New Revision: 147977

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=147977
Log:
        PR rtl-optimization/40101
        * sel-sched-ir.c (get_seqno_by_preds): Allow returning negative
        seqno.  Adjust comment.
        * sel-sched.c (find_seqno_for_bookkeeping): Assert that when
        inserting bookkeeping before a jump, the jump is not scheduled.
        When no positive seqno found, provide a value.  Add comment.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/sel-sched-ir.c
    trunk/gcc/sel-sched.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2009-05-29 15:33 ` abel at gcc dot gnu dot org
@ 2009-05-29 15:38 ` abel at gcc dot gnu dot org
  2010-08-24  8:51 ` abel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu dot org @ 2009-05-29 15:38 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from abel at gcc dot gnu dot org  2009-05-29 15:37 -------
Fixed.


-- 

abel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug rtl-optimization/40101] [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752
  2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2009-05-29 15:38 ` abel at gcc dot gnu dot org
@ 2010-08-24  8:51 ` abel at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: abel at gcc dot gnu dot org @ 2010-08-24  8:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from abel at gcc dot gnu dot org  2010-08-24 08:51 -------
Subject: Bug 40101

Author: abel
Date: Tue Aug 24 08:50:50 2010
New Revision: 163498

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163498
Log:
Backport from mainline:
        PR rtl-optimization/40101
         * sel-sched-ir.c (get_seqno_by_preds): Allow returning negative
         seqno.  Adjust comment.
         * sel-sched.c (find_seqno_for_bookkeeping): Assert that when
         inserting bookkeeping before a jump, the jump is not scheduled.
         When no positive seqno found, provide a value.  Add comment.


Modified:
    branches/gcc-4_4-branch/gcc/ChangeLog
    branches/gcc-4_4-branch/gcc/sel-sched-ir.c
    branches/gcc-4_4-branch/gcc/sel-sched.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40101


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-24  8:51 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-11 14:08 [Bug rtl-optimization/40101] New: [4.5 Regression] 200.sixtrack ICEs in get_seqno_by_preds, at sel-sched-ir.c:3752 rguenth at gcc dot gnu dot org
2009-05-11 14:08 ` [Bug rtl-optimization/40101] " rguenth at gcc dot gnu dot org
2009-05-14 14:13 ` abel at gcc dot gnu dot org
2009-05-15 13:20 ` abel at gcc dot gnu dot org
2009-05-21 10:53 ` rguenth at gcc dot gnu dot org
2009-05-26 12:20 ` abel at gcc dot gnu dot org
2009-05-29 15:33 ` abel at gcc dot gnu dot org
2009-05-29 15:38 ` abel at gcc dot gnu dot org
2010-08-24  8:51 ` abel at gcc dot gnu dot org

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).