https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103205
Bug ID: 103205 Summary: [12 Regression] ICE Segmentation fault since r12-5102-gfb161782545224f5 Product: gcc Version: 12.0 Status: UNCONFIRMED Keywords: ice-on-valid-code Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: marxin at gcc dot gnu.org CC: hjl at gcc dot gnu.org Target Milestone: --- Host: x86_64-linux-gnu The following crashes: $ cat ice.i int short sync_fetch_and_and_short_15_a; int __attribute__sync_fetch_and_and_short_15() { return __sync_fetch_and_and(&sync_fetch_and_and_short_15_a, ~1) & 1; } $ gcc ice.i -march=c3-2 -m32 -O2 -c during RTL pass: expand ice.i: In function ‘__attribute__sync_fetch_and_and_short_15’: ice.i:4:10: internal compiler error: Segmentation fault 4 | return __sync_fetch_and_and(&sync_fetch_and_and_short_15_a, ~1) & 1; | ^~~~~~~~~~~~~~~~~~~~ 0xf1db4a crash_signal /home/marxin/Programming/gcc/gcc/toplev.c:322 0x7ffff789979f ??? /usr/src/debug/glibc-2.34-2.1.x86_64/signal/../sysdeps/unix/sysv/linux/x86_64/libc_sigaction.c:0 0xb62ee1 emit_move_insn(rtx_def*, rtx_def*) /home/marxin/Programming/gcc/gcc/expr.c:4013 0x1917918 gen_atomic_bit_test_and_resethi(rtx_def*, rtx_def*, rtx_def*, rtx_def*, rtx_def*) /home/marxin/Programming/gcc/gcc/config/i386/sync.md:806 0xdec8fc maybe_expand_insn(insn_code, unsigned int, expand_operand*) /home/marxin/Programming/gcc/gcc/optabs.c:7915 0xa007bb expand_ifn_atomic_bit_test_and(gcall*) /home/marxin/Programming/gcc/gcc/builtins.c:6225 0xa2f5d7 expand_call_stmt /home/marxin/Programming/gcc/gcc/cfgexpand.c:2749 0xa2f5d7 expand_gimple_stmt_1 /home/marxin/Programming/gcc/gcc/cfgexpand.c:3876 0xa2f5d7 expand_gimple_stmt /home/marxin/Programming/gcc/gcc/cfgexpand.c:4040 0xa35464 expand_gimple_basic_block /home/marxin/Programming/gcc/gcc/cfgexpand.c:6082 0xa37687 execute /home/marxin/Programming/gcc/gcc/cfgexpand.c:6808 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.