public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/33670]  New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
@ 2007-10-05 20:06 janis at gcc dot gnu dot org
  2007-10-05 20:31 ` [Bug middle-end/33670] [4.3 Regression] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: janis at gcc dot gnu dot org @ 2007-10-05 20:06 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1359 bytes --]

Benchmark twolf in SPEC CPU2000 fails to compile on powerpc64-linux with -O2
-fsched-stalled-insns=[01234] (didn't try other values).  The following
testcase also fails for powerpc*-*-* and ia64-linux cross cc1:

  typedef struct binbox { int p; int n; } B;
  extern B ***binptr;
  extern int ablock;

  int
  foo ()
  {
    int bin, lobin, hibin;
    for (bin = lobin; bin <= hibin; bin++)
      binptr[ablock][bin]->n = binptr[ablock][bin]->p;
  }

with output

  bug8.c: In function ‘foo’:
  bug8.c:11: internal compiler error: Segmentation fault
  Please submit a full bug report,
  with preprocessed source if appropriate.
  See <http://gcc.gnu.org/bugs.html> for instructions.

The segfault occurs in sd_lists_size at sched-depc.s:600 with list=0.

The failure shows up with this patch:

    http://gcc.gnu.org/viewcvs?view=rev&rev=127405

    r127405 | mkuvyrkov | 2007-08-14 06:40:34 +0000 (Tue, 14 Aug 2007)


-- 
           Summary: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: janis at gcc dot gnu dot org
GCC target triplet: powerpc*-*-*, ia64


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
@ 2007-10-05 20:31 ` pinskia at gcc dot gnu dot org
  2007-10-10 18:13 ` mmitchel at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-10-05 20:31 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
           Keywords|                            |ice-on-valid-code
            Summary|cc1 segfault with -O2 -     |[4.3 Regression] cc1
                   |fsched-stalled-insns=0 for  |segfault with -O2 -fsched-
                   |twolf                       |stalled-insns=0 for twolf
   Target Milestone|---                         |4.3.0


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
  2007-10-05 20:31 ` [Bug middle-end/33670] [4.3 Regression] " pinskia at gcc dot gnu dot org
@ 2007-10-10 18:13 ` mmitchel at gcc dot gnu dot org
  2007-11-02 13:10 ` jakub at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2007-10-10 18:13 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
  2007-10-05 20:31 ` [Bug middle-end/33670] [4.3 Regression] " pinskia at gcc dot gnu dot org
  2007-10-10 18:13 ` mmitchel at gcc dot gnu dot org
@ 2007-11-02 13:10 ` jakub at gcc dot gnu dot org
  2007-11-02 23:07 ` jakub at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-02 13:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2007-11-02 13:10 -------
Testing a fix.
--- haifa-sched.c.jj9   2007-10-15 15:28:39.000000000 +0200
+++ haifa-sched.c       2007-11-02 14:10:20.000000000 +0100
@@ -1590,6 +1590,12 @@ ok_for_early_queue_removal (rtx insn)
            {
              int cost;

+             if (prev_insn == current_sched_info->prev_head)
+               {
+                 prev_insn = NULL;
+                 break;
+               }
+
              if (!NOTE_P (prev_insn))
                {
                  dep_t dep;


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-11-02 13:10:38
               date|                            |


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-11-02 13:10 ` jakub at gcc dot gnu dot org
@ 2007-11-02 23:07 ` jakub at gcc dot gnu dot org
  2007-11-02 23:17 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-02 23:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2007-11-02 23:06 -------
Subject: Bug 33670

Author: jakub
Date: Fri Nov  2 23:06:36 2007
New Revision: 129863

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129863
Log:
        PR middle-end/33670
        * haifa-sched.c (ok_for_early_queue_removal): Don't walk out of the
        current sched region.

        * gcc.dg/pr33670.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/pr33670.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/haifa-sched.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-11-02 23:07 ` jakub at gcc dot gnu dot org
@ 2007-11-02 23:17 ` jakub at gcc dot gnu dot org
  2007-11-03  7:45 ` maxim at codesourcery dot com
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-02 23:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2007-11-02 23:17 -------
Fixed for ppc64.

I haven't added the requested stop at the start of bb, Maxim, if you want to
do that, please go ahead.
Also, I have just found that this testcase fails on ia64 native for a different
reason (wonder why I haven't reproduced that with cross ia64 before).
On ia64 the problem is that the backend sets DO_SPECULATION in flags
in ia64_set_sched_flags - mflag_sched_ar_data_spec is 1 by default and
when user asks for -fsched-stalled-insns=5 (or =0), then
/* Perform a few consistency checks of flags in different data structures.  */
static void
check_sched_flags (void)
{
  unsigned int f = current_sched_info->flags;

  if (flag_sched_stalled_insns)
    gcc_assert (!(f & DO_SPECULATION));
  if (f & DO_SPECULATION)
    gcc_assert (!flag_sched_stalled_insns
                && spec_info
                && spec_info->mask);
}
fails.  It compiles with -O2 -fno-sched-stalled-insns or -O2
-fsched-stalled-insns=0 -mno-sched-ar-data-spec
I see no code that would try to do anything to satisfy this assert, should
ia64 disallow -fsched-stalled-insns by setting flag_sched_stalled_insns = 0?
Or if it is non-zero don't set DO_SPECULATION?  Something else?


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mkuvyrkov at gcc dot gnu dot
                   |                            |org
         AssignedTo|jakub at gcc dot gnu dot org|unassigned at gcc dot gnu
                   |                            |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-11-02 23:17 ` jakub at gcc dot gnu dot org
@ 2007-11-03  7:45 ` maxim at codesourcery dot com
  2007-11-05 16:09 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: maxim at codesourcery dot com @ 2007-11-03  7:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from maxim at codesourcery dot com  2007-11-03 07:45 -------
Subject: Re:  [4.3 Regression] cc1 segfault with -O2
 -fsched-stalled-insns=0 for twolf

jakub at gcc dot gnu dot org wrote:
> ------- Comment #3 from jakub at gcc dot gnu dot org  2007-11-02 23:17 -------
> Fixed for ppc64.
> 
> I haven't added the requested stop at the start of bb, Maxim, if you want to
> do that, please go ahead.
> Also, I have just found that this testcase fails on ia64 native for a different
> reason (wonder why I haven't reproduced that with cross ia64 before).
> On ia64 the problem is that the backend sets DO_SPECULATION in flags
> in ia64_set_sched_flags - mflag_sched_ar_data_spec is 1 by default and
> when user asks for -fsched-stalled-insns=5 (or =0), then
> /* Perform a few consistency checks of flags in different data structures.  */
> static void
> check_sched_flags (void)
> {
>   unsigned int f = current_sched_info->flags;
> 
>   if (flag_sched_stalled_insns)
>     gcc_assert (!(f & DO_SPECULATION));
>   if (f & DO_SPECULATION)
>     gcc_assert (!flag_sched_stalled_insns
>                 && spec_info
>                 && spec_info->mask);
> }
> fails.  It compiles with -O2 -fno-sched-stalled-insns or -O2
> -fsched-stalled-insns=0 -mno-sched-ar-data-spec
> I see no code that would try to do anything to satisfy this assert, should
> ia64 disallow -fsched-stalled-insns by setting flag_sched_stalled_insns = 0?
> Or if it is non-zero don't set DO_SPECULATION?  Something else?

I don't really remember why I enforced this check.  I believe, 
-fsched-stalled-insns doesn't make sense for ia64, but, anyway, if user 
wants to do that, compiler should deal with it.

There is no code in ia64 backend that will turn off either of the flags 
depending on presence of the other.  I think, this check (the whole 
function) should be simply removed, given that compiler won't ICE 
somewhere else.


-- 


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2007-11-03  7:45 ` maxim at codesourcery dot com
@ 2007-11-05 16:09 ` jakub at gcc dot gnu dot org
  2007-11-06 23:21 ` jakub at gcc dot gnu dot org
  2007-11-06 23:22 ` jakub at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-05 16:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2007-11-05 16:08 -------
Removing that function and its caller certainly fixes this testcase on
ia64-linux
and I'm currently running full make check
RUNTESTFLAGS=--target_board=unix/-fsched-stalled-insns=0
(and so far haven't seen any issues).


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-11-02 13:10:38         |2007-11-05 16:08:55
               date|                            |


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2007-11-05 16:09 ` jakub at gcc dot gnu dot org
@ 2007-11-06 23:21 ` jakub at gcc dot gnu dot org
  2007-11-06 23:22 ` jakub at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-06 23:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jakub at gcc dot gnu dot org  2007-11-06 23:20 -------
Subject: Bug 33670

Author: jakub
Date: Tue Nov  6 23:20:38 2007
New Revision: 129948

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129948
Log:
        PR middle-end/33670
        * haifa-sched.c (check_sched_flags): Remove.
        (sched_init): Don't call it.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/haifa-sched.c


-- 


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


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

* [Bug middle-end/33670] [4.3 Regression] cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf
  2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2007-11-06 23:21 ` jakub at gcc dot gnu dot org
@ 2007-11-06 23:22 ` jakub at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-11-06 23:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jakub at gcc dot gnu dot org  2007-11-06 23:22 -------
Fixed.


-- 

jakub at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2007-11-06 23:22 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-05 20:06 [Bug middle-end/33670] New: cc1 segfault with -O2 -fsched-stalled-insns=0 for twolf janis at gcc dot gnu dot org
2007-10-05 20:31 ` [Bug middle-end/33670] [4.3 Regression] " pinskia at gcc dot gnu dot org
2007-10-10 18:13 ` mmitchel at gcc dot gnu dot org
2007-11-02 13:10 ` jakub at gcc dot gnu dot org
2007-11-02 23:07 ` jakub at gcc dot gnu dot org
2007-11-02 23:17 ` jakub at gcc dot gnu dot org
2007-11-03  7:45 ` maxim at codesourcery dot com
2007-11-05 16:09 ` jakub at gcc dot gnu dot org
2007-11-06 23:21 ` jakub at gcc dot gnu dot org
2007-11-06 23:22 ` jakub 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).