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

Qirun Zhang <helloqirun at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |helloqirun at gmail dot com

--- Comment #4 from Qirun Zhang <helloqirun at gmail dot com> ---
(In reply to alahay01 from comment #3)
> "-g" is the important thing here.
> 
> A statement has been marked live, and a use of it outside the loop is a
> DEBUG stmt.
> 
> vectorizable_live_operation fails trying to treat the DEBUG stmt as a phi.

Here is a case triggering the ICE without the "-g".

I am not sure if it is a dup, so I leave it here. My bisection indicates that
the ICE for this case also starts with r237064.

$ gcc-trunk -v
Using built-in specs.
COLLECT_GCC=gcc-trunk
COLLECT_LTO_WRAPPER=/home/absozero/trunk/root-gcc/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc/configure --prefix=/home/absozero/trunk/root-gcc
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 7.0.0 20160701 (experimental) [trunk revision 237910] (GCC)


$ gcc-trunk -O3 abc.c
abc.c: In function ‘fn1’:
abc.c:4:6: internal compiler error: in as_a, at is-a.h:192
 void fn1() {
      ^~~
0x5e1131 gphi const* as_a<gphi const*, gimple const>(gimple const*)
        ../../gcc/gcc/is-a.h:192
0x5e1131 gimple_phi_num_args
        ../../gcc/gcc/gimple.h:4264
0xdbd150 gimple_phi_result
        ../../gcc/gcc/ssa-iterators.h:921
0xdbd150 vectorizable_live_operation(gimple*, gimple_stmt_iterator*,
_slp_tree*, int, gimple**)
        ../../gcc/gcc/tree-vect-loop.c:6417
0xdb6a9f vect_transform_stmt(gimple*, gimple_stmt_iterator*, bool*, _slp_tree*,
_slp_instance*)
        ../../gcc/gcc/tree-vect-stmts.c:8439
0xdbd905 vect_transform_loop(_loop_vec_info*)
        ../../gcc/gcc/tree-vect-loop.c:6893
0xdda9fe vectorize_loops()
        ../../gcc/gcc/tree-vectorizer.c:558
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 abc.c
char a;
short b;
int c, d;
void fn1() {
  char e = 75, g;
  unsigned char *f = &e;
  a = 21;
  for (; a <= 48; a++) {
    for (; e <= 6;)
      ;
    g -= e -= b || g <= c;
  }
  d = *f;
}

Reply via email to