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

            Bug ID: 124555
           Summary: [14/15/16 regression] ICE when building ffmpeg-8.0.1
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

Originally reported downstream in Gentoo at https://bugs.gentoo.org/971288.

Fails w/ `gcc -c foo.i -O2 -fno-strict-overflow`.

```
int vsad8_c_y;
char *vsad8_c_s1, *vsad8_c_s2;
long vsad8_c_stride;
int vsad8_c() {
  int score, x;
  for (; vsad8_c_y; vsad8_c_y++) {
    x = 0;
    for (; x < 8; x++)
      score += vsad8_c_s1[x] - vsad8_c_s2[x] - vsad8_c_s1[x + vsad8_c_stride] +
                           vsad8_c_s2[x + vsad8_c_stride] >=
                       0
                   ? vsad8_c_s1[x] - vsad8_c_s2[x] -
                         vsad8_c_s1[x + vsad8_c_stride] +
                         vsad8_c_s2[x + vsad8_c_stride]
                   : -(vsad8_c_s1[x] - vsad8_c_s2[x] -
                       vsad8_c_s1[x + vsad8_c_stride] +
                       vsad8_c_s2[x + vsad8_c_stride]);
    vsad8_c_s1 += vsad8_c_stride;
    vsad8_c_s2 += vsad8_c_stride;
  }
  return score;
```

```
// during RTL pass: expand
// libavcodec/me_cmp.c: In function 'vsad8_c':
// libavcodec/me_cmp.c:882:19: internal compiler error: in prepare_cmp_insn, at
optabs.cc:4638
//   882 |             score += FFABS(s1[x] - s2[x] - s1[x + stride] + s2[x +
stride]);   \
// libavcodec/me_cmp.c:889:1: note: in expansion of macro 'VSAD'
//   889 | VSAD(8)
//       | ^~~~
// 0x55555702f98d internal_error(char const*, ...)
//      ???:0
// 0x55555586b78e fancy_abort(char const*, int, char const*)
//      ???:0
// 0x555555d736cf emit_cmp_and_jump_insns(rtx_def*, rtx_def*, rtx_code,
rtx_def*, machine_mode, int, tree_node*, rtx_def*, profile_probability)
//      ???:0
// 0x555555a4ef43 do_compare_rtx_and_jump(rtx_def*, rtx_def*, rtx_code, int,
tree_node*, machine_mode, rtx_def*, rtx_code_label*, rtx_code_label*,
profile_probability)
//      ???:0
// 0x555555a50701 do_compare_rtx_and_jump(rtx_def*, rtx_def*, rtx_code, int,
machine_mode, rtx_def*, rtx_code_label*, rtx_code_label*, profile_probability)
//      ???:0
// 0x555555d8236e expand_abs(machine_mode, rtx_def*, rtx_def*, int, int)
//      ???:0
// 0x555555af7c5a expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
//      ???:0
// 0x555555af5b4e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
//      ???:0
// 0x555555af7b25 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
//      ???:0
// 0x555555aeff6b expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
//      ???:0
// 0x555555af7c5a expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
//      ???:0
// 0x555555af5b4e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
//      ???:0
// 0x555555af7b25 expand_operands(tree_node*, tree_node*, rtx_def*, rtx_def**,
rtx_def**, expand_modifier)
//      ???:0
// 0x555555aeff6b expand_expr_real_2(separate_ops*, rtx_def*, machine_mode,
expand_modifier)
//      ???:0
// 0x555555af7c5a expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
//      ???:0
// Please submit a full bug report, with preprocessed source.
// Please include the complete backtrace with any bug report.
// See <https://bugs.gentoo.org/> for instructions.
```

```

```

Reply via email to