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

            Bug ID: 121108
           Summary: [16 Regression] ICE: in setmem_epilogue_gen_val, at
                    config/i386/i386-expand.cc:8438 with
                    -mstringop-strategy=rep_4byte
           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: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: x86_64-pc-linux-gnu

Created attachment 61878
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61878&action=edit
reduced testcase

Compiler output:
$ x86_64-pc-linux-gnu-gcc -mstringop-strategy=rep_4byte testcase.c 
during RTL pass: expand
testcase.c: In function 'foo':
testcase.c:2:14: internal compiler error: in setmem_epilogue_gen_val, at
config/i386/i386-expand.cc:8438
    2 | void foo() { __builtin_memset(x, 0, 847); }
      |              ^~~~~~~~~~~~~~~~~~~~~~~~~~~
0x2b98781 internal_error(char const*, ...)
        /repo/gcc-trunk/gcc/diagnostic-global-context.cc:517
0xe053ff fancy_abort(char const*, int, char const*)
        /repo/gcc-trunk/gcc/diagnostic.cc:1818
0x951e79 setmem_epilogue_gen_val
        /repo/gcc-trunk/gcc/config/i386/i386-expand.cc:8438
0x110d67e op_by_pieces_d::run()
        /repo/gcc-trunk/gcc/expr.cc:1530
0x110dd38 store_by_pieces(rtx_def*, unsigned long, rtx_def* (*)(void*, void*,
long, fixed_size_mode), void*, unsigned int, bool, memop_ret)
        /repo/gcc-trunk/gcc/expr.cc:1854
0x1b3f9f0 expand_setmem_epilogue
        /repo/gcc-trunk/gcc/config/i386/i386-expand.cc:8493
0x1b3f9f0 ix86_expand_set_or_cpymem(rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, bool)
        /repo/gcc-trunk/gcc/config/i386/i386-expand.cc:9940
0x2358581 gen_setmemsi(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*, rtx_def*, rtx_def*, rtx_def*)
        /repo/gcc-trunk/gcc/config/i386/i386.md:26059
0x143a6d5 rtx_insn* insn_gen_fn::operator()<rtx_def*, rtx_def*, rtx_def*,
rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*>(rtx_def*,
rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*,
rtx_def*) const
        /repo/gcc-trunk/gcc/recog.h:472
0x143a6d5 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
        /repo/gcc-trunk/gcc/optabs.cc:8237
0x143f138 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
        /repo/gcc-trunk/gcc/optabs.cc:8257
0x110e706 set_storage_via_setmem(rtx_def*, rtx_def*, rtx_def*, unsigned int,
unsigned int, long, unsigned long, unsigned long, unsigned long)
        /repo/gcc-trunk/gcc/expr.cc:4043
0x112414d clear_storage_hints(rtx_def*, rtx_def*, block_op_methods, unsigned
int, long, unsigned long, unsigned long, unsigned long, unsigned int)
        /repo/gcc-trunk/gcc/expr.cc:3908
0xfa53f0 expand_builtin_memset_args
        /repo/gcc-trunk/gcc/builtins.cc:4768
0xfad75c expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int)
        /repo/gcc-trunk/gcc/builtins.cc:8265
0x111b68e expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        /repo/gcc-trunk/gcc/expr.cc:12535
0xfdc6c0 expand_expr(tree_node*, rtx_def*, machine_mode, expand_modifier)
        /repo/gcc-trunk/gcc/expr.h:323
0xfdc6c0 expand_call_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:3204
0xfdc6c0 expand_gimple_stmt_1
        /repo/gcc-trunk/gcc/cfgexpand.cc:4276
0xfdc6c0 expand_gimple_stmt
        /repo/gcc-trunk/gcc/cfgexpand.cc:4423
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.

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20250716055051-r16-2280-g32ff6f4728e402-checking-yes-rtl-df-extra-nobootstrap-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/16.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--disable-bootstrap --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu
--target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld
--with-as=/usr/bin/x86_64-pc-linux-gnu-as --enable-libsanitizer
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-20250716055051-r16-2280-g32ff6f4728e402-checking-yes-rtl-df-extra-nobootstrap-amd64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.0 20250716 (experimental) (GCC)

Reply via email to