public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
@ 2013-02-09 12:09 antoine.balestrat at gmail dot com
  2013-02-09 12:15 ` [Bug tree-optimization/56264] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: antoine.balestrat at gmail dot com @ 2013-02-09 12:09 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56264
           Summary: ICE in check_loop_closed_ssa_use, at
                    tree-ssa-loop-manip.c:557
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: antoine.balestrat@gmail.com


Using GCC 4.8.0 as of 220130209 :

$ cat check.c
int a, b, c;

void f(void)
{
    if(b)
    {
        for(a = 0; a < 1; a++)
lbl:
            c = c && b ? : 0;

        c = 0;
        goto lbl;
    }

    if(a)
        goto lbl;
}

$ xgcc -w -O2 -funswitch-loops check.c
check.c: In function ‘f’:
check.c:3:6: internal compiler error: in check_loop_closed_ssa_use, at 
tree-ssa-loop-manip.c:557
 void f(void)
      ^
0x9d90f6 check_loop_closed_ssa_use
    ../../srcdir/gcc/tree-ssa-loop-manip.c:556
0x9dac42 verify_loop_closed_ssa(bool)
    ../../srcdir/gcc/tree-ssa-loop-manip.c:602
0x83eede execute_function_todo
    ../../srcdir/gcc/passes.c:1974
0x83f757 execute_todo
    ../../srcdir/gcc/passes.c:1999
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


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

* [Bug tree-optimization/56264] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
@ 2013-02-09 12:15 ` mpolacek at gcc dot gnu.org
  2013-02-09 13:37 ` [Bug tree-optimization/56264] [4.8 Regression] " mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-09 12:15 UTC (permalink / raw)
  To: gcc-bugs


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-09
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |4.8.0
     Ever Confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-09 12:14:45 UTC ---
Confirmed.


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

* [Bug tree-optimization/56264] [4.8 Regression] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
  2013-02-09 12:15 ` [Bug tree-optimization/56264] " mpolacek at gcc dot gnu.org
@ 2013-02-09 13:37 ` mpolacek at gcc dot gnu.org
  2013-02-10 12:21 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-09 13:37 UTC (permalink / raw)
  To: gcc-bugs


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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org
            Summary|ICE in                      |[4.8 Regression] ICE in
                   |check_loop_closed_ssa_use,  |check_loop_closed_ssa_use,
                   |at                          |at
                   |tree-ssa-loop-manip.c:557   |tree-ssa-loop-manip.c:557

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-09 13:36:55 UTC ---
Started with http://gcc.gnu.org/viewcvs?view=revision&revision=195879


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

* [Bug tree-optimization/56264] [4.8 Regression] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
  2013-02-09 12:15 ` [Bug tree-optimization/56264] " mpolacek at gcc dot gnu.org
  2013-02-09 13:37 ` [Bug tree-optimization/56264] [4.8 Regression] " mpolacek at gcc dot gnu.org
@ 2013-02-10 12:21 ` rguenth at gcc dot gnu.org
  2013-02-11 10:00 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-10 12:21 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-10 12:20:51 UTC ---
Mine.  I supposed the changed_blocks stuff doesn't work reliably anymore.


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

* [Bug tree-optimization/56264] [4.8 Regression] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
                   ` (2 preceding siblings ...)
  2013-02-10 12:21 ` rguenth at gcc dot gnu.org
@ 2013-02-11 10:00 ` rguenth at gcc dot gnu.org
  2013-02-11 10:28 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-11 10:00 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-11 10:00:18 UTC ---
unswitching makes the formerly irreducible inner loop reducible on one
path (cfgcleanup makes this loop appear).  As we are in the loop optimizer
block we are supposed to be in loop-closed SSA.  Now we only mark
a single block as changed (bb 7, the loop header of the newly recognized
inner loop).  rewrite_into_loop_closed_ssa functions in the way that
it only scans changed_bbs for out-of-def-loop _uses_.  I don't see how
that can catch all changes detected by (even former) fix_loop_structure
which marks blocks as changed whose loop depth changes (that is, if a
definition block changes its loop depth but the use block does not,
like in this case, we fail to fixup loop-closed SSA form).  Not sure if
"no new loops are discovered" excluded this possibility in the old scheme.

Now, the block with the use that needs a loop-closed PHI node at the exit
of the newly discovered loop isn't changed in any way (nor is the exit block).
That said - I still fail to see the logic of the old computation of
"changed-blocks" in fix_loop_structure.  I'd said we need to re-scan
all loop blocks of loops we exit to from loops that have 'changed blocks'.
And maybe all loop blocks we may exit from to a loop that has 'changed blocks'.

Hmmmm.


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

* [Bug tree-optimization/56264] [4.8 Regression] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
                   ` (3 preceding siblings ...)
  2013-02-11 10:00 ` rguenth at gcc dot gnu.org
@ 2013-02-11 10:28 ` rguenth at gcc dot gnu.org
  2013-02-11 15:08 ` rguenth at gcc dot gnu.org
  2013-02-11 15:10 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-11 10:28 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-11 10:27:56 UTC ---
I would guess that originally cfg-cleanup caused basic-blocks to leak
outside a loop, thus at most exposing new use sites.  With discovering
new loops we may both wreck that scheme (loop depth may not change but
blocks still leak) and fail to recognize use-blocks of defs that changed
loop ownership.

Fix_loop_structure could return the number of newly discovered loops,
indicating that the whole function needs to be re-scanned (still not accounting
for weird loop tree hierarchy changes, but those shouldn't be caused by
transformations cfgcleanup does).

Testing a patch.


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

* [Bug tree-optimization/56264] [4.8 Regression] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
                   ` (4 preceding siblings ...)
  2013-02-11 10:28 ` rguenth at gcc dot gnu.org
@ 2013-02-11 15:08 ` rguenth at gcc dot gnu.org
  2013-02-11 15:10 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-11 15:08 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-11 15:07:48 UTC ---
Author: rguenth
Date: Mon Feb 11 15:07:40 2013
New Revision: 195941

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=195941
Log:
2013-02-11  Richard Biener  <rguenther@suse.de>

    PR tree-optimization/56264
    * cfgloop.h (fix_loop_structure): Adjust prototype.
    * loop-init.c (fix_loop_structure): Return the number of
    newly discovered loops.
    * tree-cfgcleanup.c (repair_loop_structures): When new loops
    are discovered, do a full loop-closed SSA rewrite.

    * gcc.dg/torture/pr56264.c: New testcase.

Added:
    trunk/gcc/testsuite/gcc.dg/torture/pr56264.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgloop.h
    trunk/gcc/loop-init.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-cfgcleanup.c


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

* [Bug tree-optimization/56264] [4.8 Regression] ICE in check_loop_closed_ssa_use, at  tree-ssa-loop-manip.c:557
  2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
                   ` (5 preceding siblings ...)
  2013-02-11 15:08 ` rguenth at gcc dot gnu.org
@ 2013-02-11 15:10 ` rguenth at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-02-11 15:10 UTC (permalink / raw)
  To: gcc-bugs


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-11 15:09:35 UTC ---
Fixed.


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

end of thread, other threads:[~2013-02-11 15:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-09 12:09 [Bug tree-optimization/56264] New: ICE in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:557 antoine.balestrat at gmail dot com
2013-02-09 12:15 ` [Bug tree-optimization/56264] " mpolacek at gcc dot gnu.org
2013-02-09 13:37 ` [Bug tree-optimization/56264] [4.8 Regression] " mpolacek at gcc dot gnu.org
2013-02-10 12:21 ` rguenth at gcc dot gnu.org
2013-02-11 10:00 ` rguenth at gcc dot gnu.org
2013-02-11 10:28 ` rguenth at gcc dot gnu.org
2013-02-11 15:08 ` rguenth at gcc dot gnu.org
2013-02-11 15:10 ` rguenth at gcc dot gnu.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).