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

            Bug ID: 125124
           Summary: [17 Regression] ICE on ffmpeg-8.1 GIMPLE pass: vect in
                    vect_bb_slp_scalar_cost, at tree-vect-slp.cc:9455
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: slyfox at gcc dot gnu.org
  Target Milestone: ---

Noticed ICE on gcc-master from r17-241-gfff26a966b9f68 (did not bisect) when
building `ffmpeg-8.1`. `cvise` extracted this sample:

// $ cat rv60dsp.c.c
char ff_rv60_idct16x16_add_dst_1, ff_rv60_idct16x16_add___trans_tmp_1;
short ff_rv60_idct16x16_add_tmp[56];
void ff_rv60_idct16x16_add() {
  for (int y; y; y++) {
    int tmp00 = 31 * ff_rv60_idct16x16_add_tmp[y * 16] -
                7 * ff_rv60_idct16x16_add_tmp[y * 16 + 1] -
                6 * ff_rv60_idct16x16_add_tmp[y * 16 + 10] -
                20 * ff_rv60_idct16x16_add_tmp[y * 16 + 4],
        tmp02 = 20 * ff_rv60_idct16x16_add_tmp[y * 16] -
                6 * ff_rv60_idct16x16_add_tmp[y * 16 + 1] +
                7 * ff_rv60_idct16x16_add_tmp[y * 16 + 10] +
                31 * ff_rv60_idct16x16_add_tmp[y * 16 + 4];
    ff_rv60_idct16x16_add_dst_1 = (tmp00 >> 7) + (tmp02 >> 7);
    {
      if (ff_rv60_idct16x16_add_dst_1)
        ff_rv60_idct16x16_add___trans_tmp_1 = ff_rv60_idct16x16_add_dst_1;
    }
    ff_rv60_idct16x16_add_dst_1 = ff_rv60_idct16x16_add___trans_tmp_1;
  }
}

$ gcc/xgcc -Bgcc -c rv60dsp.c.c -O2 -fno-strict-overflow -Wall
rv60dsp.c.c: In function ‘ff_rv60_idct16x16_add’:
rv60dsp.c.c:4:15: warning: ‘y’ is used uninitialized [-Wuninitialized]
    4 |   for (int y; y; y++) {
      |               ^
rv60dsp.c.c:4:12: note: ‘y’ was declared here
    4 |   for (int y; y; y++) {
      |            ^
during GIMPLE pass: vect
rv60dsp.c.c:3:6: internal compiler error: in vect_bb_slp_scalar_cost, at
tree-vect-slp.cc:9455
    3 | void ff_rv60_idct16x16_add() {
      |      ^~~~~~~~~~~~~~~~~~~~~
0x26ba780 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x26ac96c internal_error(char const*, ...)
        ???:0
0x26b7cb7 fancy_abort(char const*, int, char const*)
        ???:0
0x146e9d6 vect_bb_vectorization_profitable_p(_bb_vec_info*, vec<_slp_instance*,
va_heap, vl_ptr>, loop*)
        ???:0
0x147899e vect_slp_bbs(vec<basic_block_def*, va_heap, vl_ptr> const&, loop*)
        ???:0
0x1479c41 vect_slp_if_converted_bb(basic_block_def*, loop*)
        ???:0
0x148c7c4 try_vectorize_loop(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, function*)
        ???:0
0x148cbf8 (anonymous namespace)::pass_vectorize::execute(function*)
        ???:0

$ gcc/xgcc -Bgcc -v
Reading specs from gcc/specs
COLLECT_GCC=gcc/xgcc
COLLECT_LTO_WRAPPER=gcc/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /home/slyfox/dev/git/gcc/configure --disable-multilib
--disable-bootstrap --disable-lto --disable-libsanitizer --enable-languages=c
CFLAGS='-O1 -g0' CXXFLAGS='-O1 -g0' LDFLAGS='-O1 -g0'
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 17.0.0 20260501 (experimental) (GCC)

Reply via email to