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

            Bug ID: 117306
           Summary: [15 Regression] ICE on netpbm-11.8.0 with -O3
                    -march=znver2: in operator[], at vec.h:910
           Product: gcc
           Version: 15.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 today on netpbm-11.8.0 on gcc from r15-4692-g40fedaf35fa99a. DId
not bisect.

Extracted reproducer:

// $ cat pnmpsnr.c.c
struct {
  double psnr[3];
} reportTarget_psnr;
float main_compTarget_0;
int main_i;
void fprintf_();
void main(void) {
  _Bool hitsTarget;
  main_i = hitsTarget = 1;
  for (; main_i && hitsTarget; ++main_i)
    if (reportTarget_psnr.psnr[main_i] < main_compTarget_0)
      hitsTarget = 0;
  fprintf_(hitsTarget);
}

Crashing:

$ gcc/xgcc -Bgcc -c pnmpsnr.c.c -O3 -march=znver2
during GIMPLE pass: vect
pnmpsnr.c.c: In function ‘main’:
pnmpsnr.c.c:7:6: internal compiler error: in operator[], at vec.h:910
    7 | void main(void) {
      |      ^~~~
0x25463b9 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag
(*) [1], diagnostic_t)
        ???:0
0x2558085 internal_error(char const*, ...)
        ???:0
0x254328a fancy_abort(char const*, int, char const*)
        ???:0
0x1268cd4 vect_is_simple_use(vec_info*, _stmt_vec_info*, _slp_tree*, unsigned
int, tree_node**, _slp_tree**, vect_def_type*, tree_node**, _stmt_vec_info**)
        ???:0
0x1272129 vectorizable_comparison_1(vec_info*, tree_node*, _stmt_vec_info*,
tree_code, gimple_stmt_iterator*, gimple**, _slp_tree*, vec<stmt_info_for_cost,
va_heap, vl_ptr>*)
        ???:0
0x12730bf vectorizable_early_exit(vec_info*, _stmt_vec_info*,
gimple_stmt_iterator*, gimple**, _slp_tree*, vec<stmt_info_for_cost, va_heap,
vl_ptr>*)
        ???:0
0x12fcbb6 vect_slp_analyze_operations(vec_info*)
        ???:0
0x12bfba6 vect_analyze_loop_2(_loop_vec_info*, bool&, unsigned int*, unsigned
int&)
        ???:0
0x12c1a73 vect_analyze_loop_1(loop*, vec_info_shared*, vect_loop_form_info
const*, _loop_vec_info*, vec<machine_mode, va_heap, vl_ptr> const&, unsigned
int&, machine_mode&, bool&)
        ???:0
0x12c22c4 vect_analyze_loop(loop*, gimple*, vec_info_shared*)
        ???:0
0x1313dee try_vectorize_loop(hash_table<simduid_to_vf, false, xcallocator>*&,
unsigned int*, loop*, function*)
        ???:0
0x13143c0 (anonymous namespace)::pass_vectorize::execute(function*)
        ???:0
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.

$ 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 15.0.0 20241026 (experimental) (GCC)

Reply via email to