public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
@ 2013-02-26 17:42 antoine.balestrat at gmail dot com
  2013-02-26 18:01 ` [Bug tree-optimization/56466] [4.8 Regression] " 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-26 17:42 UTC (permalink / raw)
  To: gcc-bugs


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

             Bug #: 56466
           Summary: ICE in verify_loop_structure, at cfgloop.c:1629 (loop
                    with header n not in loop tree !)
    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 20130226 :

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

void f(void)
{
    for(; b; b++)
    {
        if(0)
            for(; b < 0; b++)
                if(1 % 0)
                {
                    while(1)
                    {
                        a = 0;
lbl1:
                        c++;
                    }
lbl2:
                    ;
                }

        goto lbl1;
    }

    a = 0;
    goto lbl2;
}

$ xgcc -w -funroll-loops -O2 peel.c
peel.c: In function ‘f’:
peel.c:26:1: error: loop with header 6 not in loop tree
 }
 ^
peel.c:26:1: internal compiler error: in verify_loop_structure, at
cfgloop.c:1629
0x60ffb5 verify_loop_structure()
    ../../srcdir/gcc/cfgloop.c:1629
0x7f70af peel_loops_completely
    ../../srcdir/gcc/loop-unroll.c:310
0x7f70af unroll_and_peel_loops(int)
    ../../srcdir/gcc/loop-unroll.c:215
0x7eaed7 rtl_unroll_and_peel_loops
    ../../srcdir/gcc/loop-init.c:492
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/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
@ 2013-02-26 18:01 ` mpolacek at gcc dot gnu.org
  2013-02-26 18:04 ` 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-26 18:01 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-02-26
                 CC|                            |mpolacek at gcc dot gnu.org
      Known to work|                            |4.7.3
   Target Milestone|---                         |4.8.0
            Summary|ICE in                      |[4.8 Regression] ICE in
                   |verify_loop_structure, at   |verify_loop_structure, at
                   |cfgloop.c:1629 (loop with   |cfgloop.c:1629 (loop with
                   |header n not in loop tree   |header n not in loop tree
                   |!)                          |!)
     Ever Confirmed|0                           |1
      Known to fail|                            |4.8.0

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-26 18:01:02 UTC ---
Confirmed.


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

* [Bug tree-optimization/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
  2013-02-26 18:01 ` [Bug tree-optimization/56466] [4.8 Regression] " mpolacek at gcc dot gnu.org
@ 2013-02-26 18:04 ` mpolacek at gcc dot gnu.org
  2013-02-26 18:16 ` mpolacek 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-26 18:04 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-26 18:03:47 UTC ---
Mine.


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

* [Bug tree-optimization/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
  2013-02-26 18:01 ` [Bug tree-optimization/56466] [4.8 Regression] " mpolacek at gcc dot gnu.org
  2013-02-26 18:04 ` mpolacek at gcc dot gnu.org
@ 2013-02-26 18:16 ` mpolacek at gcc dot gnu.org
  2013-02-27  9:41 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-26 18:16 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-26 18:15:28 UTC ---
Unsurprisingly started with
http://gcc.gnu.org/viewcvs?view=revision&revision=195880, but must have been
latent before.


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

* [Bug tree-optimization/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
                   ` (2 preceding siblings ...)
  2013-02-26 18:16 ` mpolacek at gcc dot gnu.org
@ 2013-02-27  9:41 ` rguenth at gcc dot gnu.org
  2013-02-27 11:42 ` [Bug rtl-optimization/56466] " mpolacek 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-27  9:41 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2013-02-27 09:40:09 UTC ---
RTL unrolling does excessive manual verify_loop_structure calls.  I suppose
we can either add an argument to verify_loop_structure to say whether to
check only existing loops or remove the checking, or make sure to fixup
loops.

For sure checking the whole loop tree after processing one innermost loop
is excessive:

/* Depending on FLAGS, check whether to peel loops completely and do so.  */
static void
peel_loops_completely (int flags)
{
  struct loop *loop;
  loop_iterator li;

  /* Scan the loops, the inner ones first.  */
  FOR_EACH_LOOP (li, loop, LI_FROM_INNERMOST)
    {
...

      if (loop->lpt_decision.decision == LPT_PEEL_COMPLETELY)
        {
          report_unroll_peel (loop, locus);
          peel_loop_completely (loop);
#ifdef ENABLE_CHECKING
          verify_loop_structure ();
#endif
        }
    }

I'd have a changed flag and do a single

  if (changed)
    fix_loop_structure (NULL);

which also does the verification at the end.  Same applies to the loop
in the caller.


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

* [Bug rtl-optimization/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
                   ` (3 preceding siblings ...)
  2013-02-27  9:41 ` rguenth at gcc dot gnu.org
@ 2013-02-27 11:42 ` mpolacek at gcc dot gnu.org
  2013-02-28 10:14 ` mpolacek at gcc dot gnu.org
  2013-02-28 10:15 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-27 11:42 UTC (permalink / raw)
  To: gcc-bugs


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|tree-optimization           |rtl-optimization

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-27 11:41:24 UTC ---
Thanks, I'm testing a fix for that.

Also changing the component, we're really on the RTL level here.


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

* [Bug rtl-optimization/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
                   ` (4 preceding siblings ...)
  2013-02-27 11:42 ` [Bug rtl-optimization/56466] " mpolacek at gcc dot gnu.org
@ 2013-02-28 10:14 ` mpolacek at gcc dot gnu.org
  2013-02-28 10:15 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-28 10:14 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #6 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-28 10:13:53 UTC ---
Author: mpolacek
Date: Thu Feb 28 10:13:48 2013
New Revision: 196335

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=196335
Log:
        PR rtl-optimization/56466
        * loop-unroll.c (unroll_and_peel_loops): Call fix_loop_structure
        if we're changing a loop.
        (peel_loops_completely): Likewise.


Added:
    trunk/gcc/testsuite/gcc.dg/pr56466.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/loop-unroll.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug rtl-optimization/56466] [4.8 Regression] ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !)
  2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
                   ` (5 preceding siblings ...)
  2013-02-28 10:14 ` mpolacek at gcc dot gnu.org
@ 2013-02-28 10:15 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2013-02-28 10:15 UTC (permalink / raw)
  To: gcc-bugs


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

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

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

--- Comment #7 from Marek Polacek <mpolacek at gcc dot gnu.org> 2013-02-28 10:15:19 UTC ---
Fixed.


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

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

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-26 17:42 [Bug tree-optimization/56466] New: ICE in verify_loop_structure, at cfgloop.c:1629 (loop with header n not in loop tree !) antoine.balestrat at gmail dot com
2013-02-26 18:01 ` [Bug tree-optimization/56466] [4.8 Regression] " mpolacek at gcc dot gnu.org
2013-02-26 18:04 ` mpolacek at gcc dot gnu.org
2013-02-26 18:16 ` mpolacek at gcc dot gnu.org
2013-02-27  9:41 ` rguenth at gcc dot gnu.org
2013-02-27 11:42 ` [Bug rtl-optimization/56466] " mpolacek at gcc dot gnu.org
2013-02-28 10:14 ` mpolacek at gcc dot gnu.org
2013-02-28 10:15 ` mpolacek 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).