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

            Bug ID: 68946
           Summary: ICE at -O3 on x86_64-linux-gnu in both 32- and 64-bit
                    modes (in vect_analyze_stmt, at
                    tree-vect-stmts.c:8013)
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chengniansun at gmail dot com
  Target Milestone: ---

The following code crashes the trunk on x86_64-linux-gnu at -O3 in both 32-bit
and 64-bit modes. 

$: 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 20151216 (experimental) [trunk revision 231674] (GCC) 
$: 
$: gcc-trunk -w -m64 small.c -O3
small.c: In function ‘fn1’:
small.c:4:6: internal compiler error: in vect_analyze_stmt, at
tree-vect-stmts.c:8013
 void fn1() {
      ^~~

0xd21f9d vect_analyze_stmt(gimple*, bool*, _slp_tree*)
        ../../gcc-trunk/gcc/tree-vect-stmts.c:8013
0xd3bd6a vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2219
0xd3bc53 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2203
0xd3bc53 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2203
0xd3bc53 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2203
0xd3cd74 vect_slp_analyze_operations(vec<_slp_instance*, va_heap, vl_ptr>,
void*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:2251
0xd41f10 vect_slp_analyze_bb_1
        ../../gcc-trunk/gcc/tree-vect-slp.c:2525
0xd41f10 vect_slp_bb(basic_block_def*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:2612
0xd44335 execute
        ../../gcc-trunk/gcc/tree-vectorizer.c:759
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.
$: 
$: gcc-trunk -w -m32 small.c -O3
small.c: In function ‘fn1’:
small.c:4:6: internal compiler error: in vect_analyze_stmt, at
tree-vect-stmts.c:8013
 void fn1() {
      ^~~

0xd21f9d vect_analyze_stmt(gimple*, bool*, _slp_tree*)
        ../../gcc-trunk/gcc/tree-vect-stmts.c:8013
0xd3bd6a vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2219
0xd3bc53 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2203
0xd3bc53 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2203
0xd3bc53 vect_slp_analyze_node_operations
        ../../gcc-trunk/gcc/tree-vect-slp.c:2203
0xd3cd74 vect_slp_analyze_operations(vec<_slp_instance*, va_heap, vl_ptr>,
void*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:2251
0xd41f10 vect_slp_analyze_bb_1
        ../../gcc-trunk/gcc/tree-vect-slp.c:2525
0xd41f10 vect_slp_bb(basic_block_def*)
        ../../gcc-trunk/gcc/tree-vect-slp.c:2612
0xd44335 execute
        ../../gcc-trunk/gcc/tree-vectorizer.c:759
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.
$: 
$: cat small.c
int a, b, g;
short c, e, h, i;
int f[8];
void fn1() {
  short j;
  for (; a;) {
    printf("%d", g);
    b = 7;
    for (; b >= 0; b--) {
      i = 1;
      short k = f[b];
      e = k ? k : 3;
      j = (i && (c |= e)) << 3;
      int l = j, m = 0;
      h = l < 0 || l >> m;
      f[b] = h;
    }
  }
}

Reply via email to