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

            Bug ID: 125875
           Summary: [14/15/16/17 Regression] ICE at -Os during RTL pass:
                    expand
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xxs_chy at outlook dot com
  Target Milestone: ---

Reproducer: https://godbolt.org/z/ojddhjWKc
Testcase:
#include <stdint.h>
typedef int16_t v4i16 __attribute__((vector_size(8)));
v4i16 g7, g19;
int64_t g16;
_Bool f16_a0_c3, f16_a0_ob6;
void f16_a0()
{
    int32_t ov10;
    uint64_t __ov_tmp_g16 = __builtin_sub_overflow(0, 0, &__ov_tmp_g16);
    g16 = __ov_tmp_g16;
lbl_b1:
    __builtin_mul_overflow(g16, g16, &ov10);
    switch (ov10)
    case 33:
        goto lbl_sw_def57;
lbl_sw_def15:
    if (f16_a0_c3) goto lbl_b1;
    g7 = __builtin_shufflevector(g7, g7, 4, 3, 4, 5);
    f16_a0_ob6 = f16_a0;
    g19 = g19 <= g19;
lbl_bf43:
    g19 = ~g19;
    g7 = __builtin_shufflevector(g7, g19, 6, 7, 0, 1);
lbl_sw_def57:
    if (f16_a0_ob6) goto lbl_sw_def15;
    goto lbl_bf43;
}

Dump at -Os:
during RTL pass: expand
<source>: In function 'f16_a0':
<source>:23:8: internal compiler error: in expand_expr_real_2, at expr.cc:11141
   23 |     g7 = __builtin_shufflevector(g7, g19, 6, 7, 0, 1);
      |     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0x2673a18 diagnostics::context::diagnostic_impl(rich_location*,
diagnostics::metadata const*, diagnostics::option_id, char const*,
__va_list_tag (*) [1], diagnostics::kind)
        ???:0
0x266865b internal_error(char const*, ...)
        ???:0
0xa2f702 fancy_abort(char const*, int, char const*)
        ???:0
0xd5aa73 expand_expr_real_gassign(gassign*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ???:0
0xd58c10 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ???:0
0xd63ddf store_expr(tree_node*, rtx_def*, int, bool, bool)
        ???:0
/cefs/31/31343204a68b684aaf248fd7_gcc-trunk-20260618/bin/../libexec/gcc/x86_64-linux-gnu/17.0.0/cc1
-quiet -imultiarch x86_64-linux-gnu -iprefix
/cefs/31/31343204a68b684aaf248fd7_gcc-trunk-20260618/bin/../lib/gcc/x86_64-linux-gnu/17.0.0/
<source> -quiet -dumpdir /app/ -dumpbase output.c -dumpbase-ext .c -masm=intel
-mtune=generic -march=x86-64 -g -Os -fdiagnostics-color=always -fno-verbose-asm
-o /app/output.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.
Compiler returned: 1

Reply via email to