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

            Bug ID: 68060
           Summary: ICE on valid code at -O3 on x86_64-linux-gnu in
                    vect_get_vec_def_for_operand, at
                    tree-vect-stmts.c:1413
           Product: gcc
           Version: 6.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
-O3 on x86_64-linux-gnu in both 32-bit and 64-bit modes.

It is a regression from 5.2.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/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20151021 (experimental) [trunk revision 229137] (GCC) 
$ 
$ gcc-trunk -O2 small.c; ./a.out
$ gcc-5.2 -O3 small.c; ./a.out
$ 
$ gcc-trunk -O3 small.c
small.c: In function ‘main’:
small.c:4:1: internal compiler error: in vect_get_vec_def_for_operand, at
tree-vect-stmts.c:1413
 main ()
 ^
0xd07273 vect_get_vec_def_for_operand(tree_node*, gimple*)
        ../../gcc-trunk/gcc/tree-vect-stmts.c:1413
0xd077e1 vect_get_vec_defs(tree_node*, tree_node*, gimple*, vec<tree_node*,
va_heap, vl_ptr>*, vec<tree_node*, va_heap, vl_ptr>*, _slp_tree*, int)
        ../../gcc-trunk/gcc/tree-vect-stmts.c:1568
0xd102c0 vectorizable_operation
        ../../gcc-trunk/gcc/tree-vect-stmts.c:4894
0xd1d956 vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
        ../../gcc-trunk/gcc/tree-vect-stmts.c:7690
0xd23b73 vect_transform_loop(_loop_vec_info*)
        ../../gcc-trunk/gcc/tree-vect-loop.c:6134
0xd3e6c7 vectorize_loops()
        ../../gcc-trunk/gcc/tree-vectorizer.c:512
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.
$ 


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


int a, b, c;

int
main ()
{
  for (; c; c++)
    for (a = 0; a < 4; a++)
      {
        c &= 5;
        for (b = 0; b < 2; b++)
          c |= 1;
      }
  return 0; 
}

Reply via email to