public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/18478] New: ICE with -funroll-loops
@ 2004-11-14 15:09 kazu at cs dot umass dot edu
  2004-11-14 15:14 ` [Bug tree-optimization/18478] " belyshev at lubercy dot com
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-11-14 15:09 UTC (permalink / raw)
  To: gcc-bugs

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

Consider:

void bar (int);

void
foo (void)
{
  unsigned arg;
  unsigned i;

  for (i = 1; i < 10; i++)
    {
      switch (i)
        {
        case 2:
        case 9:
          arg = 1;
          break;
        default:
          arg = 0;
          break;
        }

      bar (arg);
    }
}

"./cc1 -quiet -O1 -funroll-all-loops" gives

stress-dwarf2out.c: In function ‘foo’:
stress-dwarf2out.c:5: error: Missing edge 11->5
 
stress-dwarf2out.c:5: error: Missing edge 16->5
 
stress-dwarf2out.c:5: error: Missing edge 21->5
 
stress-dwarf2out.c:5: error: Missing edge 26->5
 
stress-dwarf2out.c:5: error: Missing edge 31->5
 
stress-dwarf2out.c:5: error: Missing edge 36->5
 
stress-dwarf2out.c:5: error: Missing edge 41->5
 
stress-dwarf2out.c:5: error: Missing edge 46->5
 
stress-dwarf2out.c:5: internal compiler error: verify_flow_info failed
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

The testcase is reduced from dwarf2out.i.

-- 
           Summary: ICE with -funroll-loops
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: critical
          Priority: P2
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: kazu at cs dot umass dot edu
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug tree-optimization/18478] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
@ 2004-11-14 15:14 ` belyshev at lubercy dot com
  2004-11-14 15:19 ` belyshev at lubercy dot com
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: belyshev at lubercy dot com @ 2004-11-14 15:14 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at lubercy dot com  2004-11-14 15:14 -------
heh, i am first :)

*** This bug has been marked as a duplicate of 18475 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

* [Bug tree-optimization/18478] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
  2004-11-14 15:14 ` [Bug tree-optimization/18478] " belyshev at lubercy dot com
@ 2004-11-14 15:19 ` belyshev at lubercy dot com
  2004-11-14 15:20 ` [Bug tree-optimization/18478] [4.0 Regression] " belyshev at lubercy dot com
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: belyshev at lubercy dot com @ 2004-11-14 15:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From belyshev at lubercy dot com  2004-11-14 15:19 -------
gah pardon, my fault.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |UNCONFIRMED
         Resolution|DUPLICATE                   |


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
  2004-11-14 15:14 ` [Bug tree-optimization/18478] " belyshev at lubercy dot com
  2004-11-14 15:19 ` belyshev at lubercy dot com
@ 2004-11-14 15:20 ` belyshev at lubercy dot com
  2004-11-14 15:33 ` reichelt at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: belyshev at lubercy dot com @ 2004-11-14 15:20 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|critical                    |normal
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
  GCC build triplet|i686-pc-linux-gnu           |
   GCC host triplet|i686-pc-linux-gnu           |
 GCC target triplet|i686-pc-linux-gnu           |
      Known to fail|                            |4.0.0
   Last reconfirmed|0000-00-00 00:00:00         |2004-11-14 15:20:43
               date|                            |
            Summary|ICE with -funroll-loops     |[4.0 Regression] ICE with -
                   |                            |funroll-loops
   Target Milestone|---                         |4.0.0
            Version|unknown                     |4.0.0


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (2 preceding siblings ...)
  2004-11-14 15:20 ` [Bug tree-optimization/18478] [4.0 Regression] " belyshev at lubercy dot com
@ 2004-11-14 15:33 ` reichelt at gcc dot gnu dot org
  2004-11-14 15:47 ` kazu at cs dot umass dot edu
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-14 15:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-11-14 15:33 -------
This is also a recent regression, like PR18475.

Jeff, I suspect that your patch
http://gcc.gnu.org/ml/gcc-cvs/2004-11/msg00596.html
is responsible for the regression(s), but I haven't checked that yet.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu dot org,
                   |                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (3 preceding siblings ...)
  2004-11-14 15:33 ` reichelt at gcc dot gnu dot org
@ 2004-11-14 15:47 ` kazu at cs dot umass dot edu
  2004-11-14 17:06 ` pinskia at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-11-14 15:47 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-11-14 15:47 -------
I am doing a binary search right now, but it's probably Jeff's patch that
causes this bug.

With his patch, GCC shares some CASE_LABEL_EXPR within one SWITCH_EXPR.
When a basic block is copied, I don't think these shared CASE_LABEL_EXPR
are properly updated.  Specifically, it's possible that one CASE_LABEL_EXPR
points to another CASE_LABEL_EXPR of another SWITCH_EXPR.


-- 


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (4 preceding siblings ...)
  2004-11-14 15:47 ` kazu at cs dot umass dot edu
@ 2004-11-14 17:06 ` pinskia at gcc dot gnu dot org
  2004-11-14 17:30 ` kazu at cs dot umass dot edu
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-14 17:06 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-14 17:06 -------
Even though they might not be dups, they are related bugs.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
  BugsThisDependsOn|                            |18475


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (5 preceding siblings ...)
  2004-11-14 17:06 ` pinskia at gcc dot gnu dot org
@ 2004-11-14 17:30 ` kazu at cs dot umass dot edu
  2004-11-14 17:50 ` giovannibajo at libero dot it
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: kazu at cs dot umass dot edu @ 2004-11-14 17:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From kazu at cs dot umass dot edu  2004-11-14 17:30 -------
*** Bug 18475 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
Bug 18478 depends on bug 18475, which changed state.

Bug 18475 Summary: [4.0 Regression] ICE Segmentation fault in tree_verify_flow_info with -funswitch-loops
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18475

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATEBug 18478 depends on bug 18475, which changed state.

Bug 18475 Summary: [4.0 Regression] ICE Segmentation fault in tree_verify_flow_info with -funswitch-loops
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18475

           What    |Old Value                   |New Value
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE

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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (6 preceding siblings ...)
  2004-11-14 17:30 ` kazu at cs dot umass dot edu
@ 2004-11-14 17:50 ` giovannibajo at libero dot it
  2004-11-15 17:02 ` law at redhat dot com
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: giovannibajo at libero dot it @ 2004-11-14 17:50 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-11-14 17:49 -------
Well, if unshare_expr is invalid for SWITCH_EXPRs, I guess you should either do 
your check within unshare_expr itself, or at least add a gcc_assert() to 
unshare_expr so that we check that it is never called with a SWITCH_EXPR. I 
would go for the former, so that the users don't have to do the same check 
externally.

-- 


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (7 preceding siblings ...)
  2004-11-14 17:50 ` giovannibajo at libero dot it
@ 2004-11-15 17:02 ` law at redhat dot com
  2004-11-15 17:56 ` law at redhat dot com
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: law at redhat dot com @ 2004-11-15 17:02 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From law at redhat dot com  2004-11-15 17:01 -------
Subject: Re:  [4.0 Regression] ICE with
	-funroll-loops

On Sun, 2004-11-14 at 15:47 +0000, kazu at cs dot umass dot edu wrote:
> ------- Additional Comments From kazu at cs dot umass dot edu  2004-11-14 15:47 -------
> I am doing a binary search right now, but it's probably Jeff's patch that
> causes this bug.
> 
> With his patch, GCC shares some CASE_LABEL_EXPR within one SWITCH_EXPR.
> When a basic block is copied, I don't think these shared CASE_LABEL_EXPR
> are properly updated.  Specifically, it's possible that one CASE_LABEL_EXPR
> points to another CASE_LABEL_EXPR of another SWITCH_EXPR.
I'll take a look.  It shouldn't be terribly hard to make sure the
right thing happens when we copy SWITCH_EXPRs.

[ This does make me wonder about any copying we do during inlining
  as well.   I'll look at that too. ]



jeff




-- 


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (8 preceding siblings ...)
  2004-11-15 17:02 ` law at redhat dot com
@ 2004-11-15 17:56 ` law at redhat dot com
  2004-11-16  4:25 ` law at redhat dot com
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: law at redhat dot com @ 2004-11-15 17:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From law at redhat dot com  2004-11-15 17:56 -------
Subject: Re:  [4.0 Regression] ICE with
	-funroll-loops

On Sun, 2004-11-14 at 17:50 +0000, giovannibajo at libero dot it wrote:
> ------- Additional Comments From giovannibajo at libero dot it  2004-11-14 17:49 -------
> Well, if unshare_expr is invalid for SWITCH_EXPRs, I guess you should either do 
> your check within unshare_expr itself, or at least add a gcc_assert() to 
> unshare_expr so that we check that it is never called with a SWITCH_EXPR. I 
> would go for the former, so that the users don't have to do the same check 
> externally.
Well, this is a bloody interesting can of worms.  I hadn't pondered
someone copying a SWITCH_EXPR when I made my changes.  My bad.

The bad news is I don't really like any of the options to fix this
problem as they're going to involve special casing SWITCH_EXPR
in the copying/unsharing code in one form or another.  I'm seriously
considering reverting those changes.

Losing the case leader concept isn't as terrible as you might think
once we have the hash table available in tree_redirect_edge_and_branch.
Having a case leader means we don't have to walk the set of equivalent
cases to update their labels.  [ Note we'll just be walking equivalent
labels, not the entire vector. ]

Alternately, we hack up the copying/unsharing code to deal with this
"wart".

Jeff



-- 


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (9 preceding siblings ...)
  2004-11-15 17:56 ` law at redhat dot com
@ 2004-11-16  4:25 ` law at redhat dot com
  2004-11-16 13:54 ` pinskia at gcc dot gnu dot org
  2004-11-18 12:51 ` reichelt at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: law at redhat dot com @ 2004-11-16  4:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From law at redhat dot com  2004-11-16 04:25 -------
Subject: Re:  [4.0 Regression] ICE with
	-funroll-loops

On Sun, 2004-11-14 at 17:50 +0000, giovannibajo at libero dot it wrote:
> ------- Additional Comments From giovannibajo at libero dot it  2004-11-14 17:49 -------
> Well, if unshare_expr is invalid for SWITCH_EXPRs, I guess you should either do 
> your check within unshare_expr itself, or at least add a gcc_assert() to 
> unshare_expr so that we check that it is never called with a SWITCH_EXPR. I 
> would go for the former, so that the users don't have to do the same check 
> externally.
After poking at this in various ways today, I think we're going to be
best off losing the CASE_LEADER idea for now.

I couldn't come up with anything I liked in terms of changes to the
node copying code.

I'm testing changes to introduce using the edge to cases hash table
during thread_jumps and split_critical_edges which ought to keep us
from regressing on 15524 when I remove the CASE_LEADER code.

jeff




-- 


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (10 preceding siblings ...)
  2004-11-16  4:25 ` law at redhat dot com
@ 2004-11-16 13:54 ` pinskia at gcc dot gnu dot org
  2004-11-18 12:51 ` reichelt at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-11-16 13:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-11-16 13:54 -------
*** Bug 18521 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |micis at gmx dot de


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


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

* [Bug tree-optimization/18478] [4.0 Regression] ICE with -funroll-loops
  2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
                   ` (11 preceding siblings ...)
  2004-11-16 13:54 ` pinskia at gcc dot gnu dot org
@ 2004-11-18 12:51 ` reichelt at gcc dot gnu dot org
  12 siblings, 0 replies; 14+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2004-11-18 12:51 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From reichelt at gcc dot gnu dot org  2004-11-18 12:51 -------
Fixed by Jeff's patch
http://gcc.gnu.org/ml/gcc-cvs/2004-11/msg00823.html


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


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


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

end of thread, other threads:[~2004-11-18 12:51 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-14 15:09 [Bug tree-optimization/18478] New: ICE with -funroll-loops kazu at cs dot umass dot edu
2004-11-14 15:14 ` [Bug tree-optimization/18478] " belyshev at lubercy dot com
2004-11-14 15:19 ` belyshev at lubercy dot com
2004-11-14 15:20 ` [Bug tree-optimization/18478] [4.0 Regression] " belyshev at lubercy dot com
2004-11-14 15:33 ` reichelt at gcc dot gnu dot org
2004-11-14 15:47 ` kazu at cs dot umass dot edu
2004-11-14 17:06 ` pinskia at gcc dot gnu dot org
2004-11-14 17:30 ` kazu at cs dot umass dot edu
2004-11-14 17:50 ` giovannibajo at libero dot it
2004-11-15 17:02 ` law at redhat dot com
2004-11-15 17:56 ` law at redhat dot com
2004-11-16  4:25 ` law at redhat dot com
2004-11-16 13:54 ` pinskia at gcc dot gnu dot org
2004-11-18 12:51 ` reichelt 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).