https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94518
Bug ID: 94518 Summary: [9 Regression] ICE: RTL check: expected code 'const_int', have 'reg' in output_3774, at config/aarch64/atomics.md:758 Product: gcc Version: 9.3.1 Status: UNCONFIRMED Keywords: ice-checking 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: aarch64-unknown-linux-gnu Created attachment 48229 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48229&action=edit reduced testcase This looks like a recent regression on the 9-branch. Compiler output: $ $ /repo/build-gcc-9-branch-aarch64/./gcc/cc1plus tsan_interface_atomic.ii void b() Analyzing compilation unit Performing interprocedural optimizations <*free_lang_data> <visibility> <build_ssa_passes> <opt_local_passes> <remove_symbols> <targetclone> <free-fnsummary>Streaming LTO <whole-program> <fnsummary> <inline> <free-fnsummary> <single-use> <comdats>Assembling functions: <materialize-all-clones> <simdclone> void b()during RTL pass: final tsan_interface_atomic.ii: In function 'void b()': tsan_interface_atomic.ii:2:41: internal compiler error: RTL check: expected code 'const_int', have 'reg' in output_3774, at config/aarch64/atomics.md:758 2 | void b() { __sync_fetch_and_xor(&a, c); } | ^ 0x776cd1 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*) /repo/gcc-9-branch/gcc/rtl.c:888 0x9206f4 output_3774 /repo/gcc-9-branch/gcc/config/aarch64/atomics.md:758 0xdc764b final_scan_insn_1 /repo/gcc-9-branch/gcc/final.c:3040 0xdc7f7b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) /repo/gcc-9-branch/gcc/final.c:3153 0xdc8267 final_1 /repo/gcc-9-branch/gcc/final.c:2021 0xdc90c6 rest_of_handle_final /repo/gcc-9-branch/gcc/final.c:4659 0xdc90c6 execute /repo/gcc-9-branch/gcc/final.c:4737 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. Build with RTL checking is broken: ... libtool: compile: /repo/build-gcc-9-branch-aarch64/./gcc/xgcc -shared-libgcc -B/repo/build-gcc-9-branch-aarch64/./gcc -nostdinc++ -L/repo/build-gcc-9-branch-aarch64/aarch64-unknown-linux-gnu/libstdc++-v3/src -L/repo/build-gcc-9-branch-aarch64/aarch64-unknown-linux-gnu/libstdc++-v3/src/.libs -L/repo/build-gcc-9-branch-aarch64/aarch64-unknown-linux-gnu/libstdc++-v3/libsupc++/.libs -B/repo/gcc-9-branch//binary-9-branch-20200407083310-g1168240fbe4-checking-yes-rtl-df-extra-aarch64/aarch64-unknown-linux-gnu/bin/ -B/repo/gcc-9-branch//binary-9-branch-20200407083310-g1168240fbe4-checking-yes-rtl-df-extra-aarch64/aarch64-unknown-linux-gnu/lib/ -isystem /repo/gcc-9-branch//binary-9-branch-20200407083310-g1168240fbe4-checking-yes-rtl-df-extra-aarch64/aarch64-unknown-linux-gnu/include -isystem /repo/gcc-9-branch//binary-9-branch-20200407083310-g1168240fbe4-checking-yes-rtl-df-extra-aarch64/aarch64-unknown-linux-gnu/sys-include -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DCAN_SANITIZE_UB=0 -I. -I/repo/gcc-9-branch/libsanitizer/tsan -I.. -I /repo/gcc-9-branch/libsanitizer -I /repo/gcc-9-branch/libsanitizer/include -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fno-rtti -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -I../../libstdc++-v3/include -I../../libstdc++-v3/include/aarch64-unknown-linux-gnu -I/repo/gcc-9-branch/libsanitizer/../libstdc++-v3/libsupc++ -std=gnu++11 -g -O2 -D_GNU_SOURCE -MT tsan_interface_atomic.lo -MD -MP -MF .deps/tsan_interface_atomic.Tpo -c /repo/gcc-9-branch/libsanitizer/tsan/tsan_interface_atomic.cc -fPIC -DPIC -o .libs/tsan_interface_atomic.o during RTL pass: final /repo/gcc-9-branch/libsanitizer/tsan/tsan_interface_atomic.cc: In function 'bool AtomicCAS(__tsan::ThreadState*, __sanitizer::uptr, volatile T*, T*, T, __tsan::morder, __tsan::morder) [with T = __int128]': /repo/gcc-9-branch/libsanitizer/tsan/tsan_interface_atomic.cc:432:1: internal compiler error: RTL check: expected code 'const_int', have 'reg' in output_3774, at config/aarch64/atomics.md:758 432 | } | ^ 0x776cd1 rtl_check_failed_code1(rtx_def const*, rtx_code, char const*, int, char const*) /repo/gcc-9-branch/gcc/rtl.c:888 0x9206f4 output_3774 /repo/gcc-9-branch/gcc/config/aarch64/atomics.md:758 0xdc764b final_scan_insn_1 /repo/gcc-9-branch/gcc/final.c:3040 0xdc7f7b final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) /repo/gcc-9-branch/gcc/final.c:3153 0xdc8267 final_1 /repo/gcc-9-branch/gcc/final.c:2021 0xdc90c6 rest_of_handle_final /repo/gcc-9-branch/gcc/final.c:4659 0xdc90c6 execute /repo/gcc-9-branch/gcc/final.c:4737 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.