This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/71595] New: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu: in check_loop_closed_ssa_use, at tree-ssa-loop-manip.c:704


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71595

            Bug ID: 71595
           Summary: ICE on valid code at -O2 and -O3 on x86_64-linux-gnu:
                    in check_loop_closed_ssa_use, at
                    tree-ssa-loop-manip.c:704
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk at
-O2 and -O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes. 

It is a regression from 6.1.x.


$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/usr/local/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 7.0.0 20160620 (experimental) [trunk revision 237587] (GCC) 
$ 
$ gcc-trunk -Os -c small.c
$ gcc-6.1 -O2 -c small.c
$ 
$ gcc-trunk -O2 -c small.c
small.c: In function âfn1â:
small.c:6:1: internal compiler error: in check_loop_closed_ssa_use, at
tree-ssa-loop-manip.c:704
 fn1 ()
 ^~~
0xd2e54c check_loop_closed_ssa_use
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:703
0xd31306 check_loop_closed_ssa_stmt
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:719
0xd31306 verify_loop_closed_ssa(bool)
        ../../gcc-source-trunk/gcc/tree-ssa-loop-manip.c:753
0xd1537e tree_unroll_loops_completely(bool, bool)
        ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1431
0xd1540a execute
        ../../gcc-source-trunk/gcc/tree-ssa-loop-ivcanon.c:1537
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.
$ 


-------------------------------------


volatile int a, e;
int c, d[1][5];
long b;

void
fn1 ()
{
  for (; c;)
    {
      int f = c = 0;
      for (; c < 3; c++)
        {
          c && a;
          if (e)
            f = 1;
          b++;
          d[b][b + 1] = 1;
          if (f)
            break;
        }
    }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]