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

            Bug ID: 127051
           Summary: ICE on valid code at -O{2,3} with -fno-vect-cost-model
                    on x86_64-linux-gnu: in quick_push, at vec.h:1050
           Product: gcc
           Version: 16.0
            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/qxsb6edxj

Note:
- fails: trunk
- works: 16.2 and earlier

[535] % 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/17.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++,lto --disable-werror
--disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260825 (experimental) [master r17-1628-gd1c12591336] (GCC) 
[536] % 
[536] % gcctk -O2 -c -fno-vect-cost-model small.c
during GIMPLE pass: slp
small.c: In function ‘b’:
small.c:1:5: internal compiler error: in quick_push, at vec.h:1050
    1 | int b(int c, int d, int e, int f, int g, int h) {
      |     ^
0x27efc6b internal_error(char const*, ...)
        ../../gcc-trunk/gcc/diagnostic-global-context.cc:787
0xa32023 fancy_abort(char const*, int, char const*)
        ../../gcc-trunk/gcc/diagnostics/context.cc:1813
0x928498 vec<int, va_heap, vl_embed>::quick_push(int const&)
        ../../gcc-trunk/gcc/vec.h:1050
0x928dc7 vec<tree_node*, va_heap, vl_embed>::quick_push(tree_node* const&)
        ../../gcc-trunk/gcc/ssa-iterators.h:564
0x928dc7 vec<tree_node*, va_heap, vl_ptr>::quick_push(tree_node* const&)
        ../../gcc-trunk/gcc/vec.h:2081
0x928dc7 _slp_tree::push_vec_def(gimple*)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:169
0x1511381 vectorizable_conversion
        ../../gcc-trunk/gcc/tree-vect-stmts.cc:5871
0x1512210 vect_transform_stmt(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, _slp_tree*, _slp_instance*)
        ../../gcc-trunk/gcc/tree-vect-stmts.cc:13162
0x1560df5 vect_schedule_slp_node
        ../../gcc-trunk/gcc/tree-vect-slp.cc:12316
0x1579cb0 vect_schedule_scc
        ../../gcc-trunk/gcc/tree-vect-slp.cc:12583
0x157a339 vect_schedule_slp(vec_info*, vec<_slp_instance*, va_heap, vl_ptr>&,
bool)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:12748
0x157c27e vect_slp_region
        ../../gcc-trunk/gcc/tree-vect-slp.cc:10498
0x157e1db vect_slp_bbs
        ../../gcc-trunk/gcc/tree-vect-slp.cc:10609
0x157e790 vect_slp_function(function*)
        ../../gcc-trunk/gcc/tree-vect-slp.cc:10731
0x1589d21 execute
        ../../gcc-trunk/gcc/tree-vectorizer.cc:1573
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/17.0.0/cc1
-quiet -I /usr/local/include -I /local/suz-local/software/local/include
-imultiarch x86_64-linux-gnu -iprefix
/local/home/suz/suz-local/software/local/gcc-trunk/bin/../lib/gcc/x86_64-pc-linux-gnu/17.0.0/
small.c -quiet -dumpbase small.c -dumpbase-ext .c -mtune=generic -march=x86-64
-O2 -fvect-cost-model=unlimited -o /tmp/ccWaIEG3.s
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.
[537] % 
[537] % cat small.c
int b(int c, int d, int e, int f, int g, int h) {
  long a = c;
  a += d;
  a += e;
  a += f;
  a += g;
  a += h;
  return a;
}

Reply via email to