https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118197
Zdenek Sojka <zsojka at seznam dot cz> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords|ice-on-invalid-code |ice-on-valid-code Known to fail| |13.3.1, 14.2.1, 15.0 --- Comment #1 from Zdenek Sojka <zsojka at seznam dot cz> --- Compiler output: $ riscv64-unknown-linux-gnu-gcc -O1 testcase.c -wrapper valgrind,-q ==10719== Invalid read of size 2 ==10719== at 0x13E8E6D: emit_move_insn(rtx_def*, rtx_def*) (expr.cc:4635) ==10719== by 0x1CC3393: riscv_lshift_subword(machine_mode, rtx_def*, rtx_def*, rtx_def**) (riscv.cc:11753) ==10719== by 0x26AD397: gen_lrsc_atomic_fetch_andhi(rtx_def*, rtx_def*, rtx_def*, rtx_def*) (sync.md:355) ==10719== by 0x24EA6E4: gen_atomic_fetch_andhi(rtx_def*, rtx_def*, rtx_def*, rtx_def*) (sync.md:310) ==10719== by 0x16DA853: maybe_expand_insn (optabs.cc:8237) ==10719== by 0x16DA853: maybe_emit_op(atomic_op_functions const*, rtx_def*, rtx_def*, rtx_def*, bool, memmodel, bool) (optabs.cc:7664) ==10719== by 0x16E9D76: expand_atomic_fetch_op_no_fallback(rtx_def*, rtx_def*, rtx_def*, rtx_code, memmodel, bool) (optabs.cc:7732) ==10719== by 0x16E9F00: expand_atomic_fetch_op(rtx_def*, rtx_def*, rtx_def*, rtx_code, memmodel, bool) (optabs.cc:7787) ==10719== by 0x12672FE: expand_builtin_atomic_fetch_op(machine_mode, tree_node*, rtx_def*, rtx_code, bool, bool, built_in_function) (builtins.cc:6946) ==10719== by 0x12733CA: expand_builtin(tree_node*, rtx_def*, rtx_def*, machine_mode, int) (builtins.cc:8907) ==10719== by 0x13E3D8C: expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) (expr.cc:12454) ==10719== by 0x12A1980: expand_expr (expr.h:323) ==10719== by 0x12A1980: expand_call_stmt (cfgexpand.cc:2902) ==10719== by 0x12A1980: expand_gimple_stmt_1 (cfgexpand.cc:3975) ==10719== by 0x12A1980: expand_gimple_stmt(gimple*) (cfgexpand.cc:4122) ==10719== by 0x12A224F: expand_gimple_basic_block(basic_block_def*, bool) (cfgexpand.cc:6185) ==10719== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==10719== during RTL pass: expand testcase.c: In function 'foo': testcase.c:8:3: internal compiler error: Segmentation fault 8 | __atomic_and_fetch(&s, s, 0); | ^~~~~~~~~~~~~~~~~~ ... $ riscv64-unknown-linux-gnu-gcc -v Using built-in specs. COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-20241221205213-r15-6409-g7d83a32aacd600-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/15.0.0/lto-wrapper Target: riscv64-unknown-linux-gnu Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++ --enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra --with-cloog --with-ppl --with-isl --with-isa-spec=2.2 --with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu --with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld --with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib --enable-libsanitizer --disable-libstdcxx-pch --prefix=/repo/gcc-trunk//binary-trunk-20241221205213-r15-6409-g7d83a32aacd600-checking-yes-rtl-df-extra-riscv64 Thread model: posix Supported LTO compression algorithms: zlib zstd gcc version 15.0.0 20241221 (experimental) (GCC)