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

            Bug ID: 59519
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu in
                    slpeel_update_phi_nodes_for_guard1, at
                    tree-vect-loop-manip.c:486
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu

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

It is a regression from 4.8.x. 

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/4.9.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++,lto --enable-checking=release --disable-werror
--enable-multilib
Thread model: posix
gcc version 4.9.0 20131215 (experimental) [trunk revision 206004] (GCC) 
$ 
$ gcc-trunk -O2 -c small.c
$ gcc-4.8 -O3 -c small.c
$ 
$ gcc-trunk -O3 -c small.c
small.c: In function ‘foo’:
small.c:9:1: internal compiler error: in slpeel_update_phi_nodes_for_guard1, at
tree-vect-loop-manip.c:486
 foo ()
 ^
0xa01706 slpeel_update_phi_nodes_for_guard1
    ../../gcc-trunk/gcc/tree-vect-loop-manip.c:486
0xa01706 slpeel_tree_peel_loop_to_edge
    ../../gcc-trunk/gcc/tree-vect-loop-manip.c:1411
0xa02281 vect_do_peeling_for_alignment(_loop_vec_info*, tree_node*, unsigned
int, bool)
    ../../gcc-trunk/gcc/tree-vect-loop-manip.c:2009
0x9f624f vect_transform_loop(_loop_vec_info*)
    ../../gcc-trunk/gcc/tree-vect-loop.c:5797
0xa0dacf vectorize_loops()
    ../../gcc-trunk/gcc/tree-vectorizer.c:473
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.
$ 


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


struct
{
  int f0;
} d;

int a[8] = {0}, b, c, e;

void
foo ()
{
  for (; e < 1; e++)
    for (b = 0; b < 7; b++)
      {
    c |= (a[b+1] != 0);
    if (d.f0)
      break;
      }
}

Reply via email to