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

            Bug ID: 120211
           Summary: ICE on valid code at -O3 with "-fno-tree-copy-prop
                    -fno-tree-dominator-opts -fno-tree-loop-ivcanon
                    -fno-tree-pre -fno-code-hoisting" on x86_64-linux-gnu:
                    in gimple_phi_arg_def_from_edge, at gimple.h:4759
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
  Target Milestone: ---

Compiler Explorer: https://godbolt.org/z/osPh7hq4h

It might be a recent regression as it doesn't reproduce with 15.1 and earlier.


[590] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 16.0.0 20250510 (experimental) (GCC) 
[591] % 
[591] % gcctk -O3 -fno-tree-copy-prop -fno-tree-dominator-opts
-fno-tree-loop-ivcanon -fno-tree-pre -fno-code-hoisting small.c
during GIMPLE pass: vect
small.c: In function ‘main’:
small.c:2:5: internal compiler error: in gimple_phi_arg_def_from_edge, at
gimple.h:4759
    2 | int main() {
      |     ^~~~
0x2633896 internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:517
0x9f0f42 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostic.cc:1815
0x8f76ed gimple_phi_arg_def_from_edge(gphi const*, edge_def const*)
        ../../gcc-trunk/gcc/gimple.h:4759
0x8f76ed gimple_phi_arg_def_from_edge(gphi const*, edge_def const*)
        ../../gcc-trunk/gcc/gimple.h:4757
0x8f76ed vect_analyze_slp(vec_info*, unsigned int, bool)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:4986
0x1458304 vect_analyze_loop_2
        ../../gcc-trunk/gcc/tree-vect-loop.cc:2861
0x145a1f4 vect_analyze_loop_1
        ../../gcc-trunk/gcc/tree-vect-loop.cc:3422
0x145a94b vect_analyze_loop(loop*, gimple*, vec_info_shared*)
        ../../gcc-trunk/gcc/tree-vect-loop.cc:3582
0x14b443c try_vectorize_loop_1
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1095
0x14b443c try_vectorize_loop
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1214
0x14b4d8c execute
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1330
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[592] % 
[592] % cat small.c
int a, b[1];
int main() {
  int c = 0;
  for (; c < 1; c++) {
    while (a)
      c++;
    b[c] = 0;
  }
}

Reply via email to