https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94368
Bug ID: 94368 Summary: [9/10 Regression] ICE in final_scan_insn_1, at final.c:3074(error: could not split insn) on aarch64-linux-gnu Product: gcc Version: 9.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: rtl-optimization Assignee: unassigned at gcc dot gnu.org Reporter: doko at debian dot org Target Milestone: --- seen with gcc-9 branch 20200325, with -O1 on aarch64-linux-gnu. $ cat partr.i # 5 "" 3 b, c, d, e, f; short g; a() __attribute__((__const__)); h() { i: for (;;) { __atomic_load_n(&e, d); long j = a(2) && __sync_val_compare_and_swap(&c, 0, j); b = 1; if (h == e) break; } __sync_val_compare_and_swap(&g, -1, f); goto i; } $ gcc-9 -c -O1 -Wall partr.i : In function ‘h’: :19:1: error: could not split insn (insn 51 49 110 (parallel [ (set (reg:CC 66 cc) (unspec_volatile:CC [ (const_int 0 [0]) ] UNSPECV_ATOMIC_CMPSW)) (set (reg:SI 1 x1 [125]) (zero_extend:SI (mem/v:HI (reg/f:DI 27 x27 [132]) [-1 S2 A16]))) (set (mem/v:HI (reg/f:DI 27 x27 [132]) [-1 S2 A16]) (unspec_volatile:HI [ (const_int -1 [0xffffffffffffffff]) (reg:HI 0 x0 [orig:122 f ] [122]) (const_int 0 [0]) (const_int 32773 [0x8005]) repeated x2 ] UNSPECV_ATOMIC_CMPSW)) (clobber (reg:SI 2 x2 [138])) ]) "":17:3 3636 {aarch64_compare_and_swaphi} (expr_list:REG_DEAD (reg:HI 0 x0 [orig:122 f ] [122]) (expr_list:REG_UNUSED (reg:CC 66 cc) (expr_list:REG_UNUSED (reg:SI 2 x2 [138]) (expr_list:REG_UNUSED (reg:SI 1 x1 [125]) (nil)))))) during RTL pass: final :19:1: internal compiler error: in final_scan_insn_1, at final.c:3074 Please submit a full bug report, with preprocessed source if appropriate. $ gcc-10 -c -O1 -Wall partr.i : In function ‘h’: :19:1: error: could not split insn (insn 49 47 5 (parallel [ (set (reg:CC 66 cc) (unspec_volatile:CC [ (const_int 0 [0]) ] UNSPECV_ATOMIC_CMPSW)) (set (reg:SI 1 x1 [127]) (zero_extend:SI (mem/v:HI (reg/f:DI 27 x27 [120]) [-1 S2 A16]))) (set (mem/v:HI (reg/f:DI 27 x27 [120]) [-1 S2 A16]) (unspec_volatile:HI [ (const_int -1 [0xffffffffffffffff]) (reg:HI 0 x0 [orig:124 f ] [124]) (const_int 0 [0]) (const_int 32773 [0x8005]) repeated x2 ] UNSPECV_ATOMIC_CMPSW)) (clobber (reg:SI 2 x2 [137])) ]) "":17:3 3908 {aarch64_compare_and_swaphi} (expr_list:REG_DEAD (reg:HI 0 x0 [orig:124 f ] [124]) (expr_list:REG_UNUSED (reg:CC 66 cc) (expr_list:REG_UNUSED (reg:SI 2 x2 [137]) (expr_list:REG_UNUSED (reg:SI 1 x1 [127]) (nil)))))) during RTL pass: final :19:1: internal compiler error: in final_scan_insn_1, at final.c:3073 0x60be4f _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) ../../src/gcc/rtl-error.c:108 0x8380bb final_scan_insn_1 ../../src/gcc/final.c:3073 0x8382d3 final_scan_insn(rtx_insn*, _IO_FILE*, int, int, int*) ../../src/gcc/final.c:3152 0x8385a7 final_1 ../../src/gcc/final.c:2020 0x838d23 rest_of_handle_final ../../src/gcc/final.c:4658 0x838d23 execute ../../src/gcc/final.c:4736 Please submit a full bug report, with preprocessed source if appropriate. this is a compiler with hardening flags enabled by default.