From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C69313947438; Thu, 8 Apr 2021 16:54:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C69313947438 From: "acoplan at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/99977] New: arm: ICE with __sync_bool_compare_and_swap and -mcpu=cortex-m23 Date: Thu, 08 Apr 2021 16:54:05 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: acoplan at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Apr 2021 16:54:05 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99977 Bug ID: 99977 Summary: arm: ICE with __sync_bool_compare_and_swap and -mcpu=3Dcortex-m23 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: acoplan at gcc dot gnu.org Target Milestone: --- The following fails: $ cat t1.c int a[1]; void f() { __sync_bool_compare_and_swap(a, -1, 0); } $ arm-eabi-gcc -c t1.c -mcpu=3Dcortex-m23 t1.c: In function 'f': t1.c:2:52: error: insn does not satisfy its constraints: 2 | void f() { __sync_bool_compare_and_swap(a, -1, 0); } | ^ (jump_insn 29 28 30 (parallel [ (set (pc) (if_then_else (ne (reg:SI 0 r0 [115]) (const_int -1 [0xffffffffffffffff])) (label_ref 32) (pc))) (clobber (scratch:SI)) ]) "t1.c":2:12 950 {cbranchsi4_scratch} (int_list:REG_BR_PROB 536868 (nil)) -> 32) during RTL pass: mach t1.c:2:52: internal compiler error: in extract_constrain_insn, at recog.c:2= 671 0xcc1fd5 _fatal_insn(char const*, rtx_def const*, char const*, int, char const*) /home/alecop01/toolchain/src/gcc/gcc/rtl-error.c:108 0xcc2006 _fatal_insn_not_found(rtx_def const*, char const*, int, char const= *) /home/alecop01/toolchain/src/gcc/gcc/rtl-error.c:118 0xc91f2f extract_constrain_insn(rtx_insn*) /home/alecop01/toolchain/src/gcc/gcc/recog.c:2671 0x1194ac1 note_invalid_constants /home/alecop01/toolchain/src/gcc/gcc/config/arm/arm.c:18053 0x1194ac1 arm_reorg /home/alecop01/toolchain/src/gcc/gcc/config/arm/arm.c:19195 0xcc1c9f execute /home/alecop01/toolchain/src/gcc/gcc/reorg.c:4045 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions. If we change the second argument to -8, we ICE in LRA instead: $ cat t2.c int a[1]; void f() { __sync_bool_compare_and_swap(a, -8, 0); } $ arm-eabi-gcc -c t2.c -mcpu=3Dcortex-m23 during RTL pass: reload t2.c: In function 'f': t2.c:2:52: internal compiler error: in curr_insn_transform, at lra-constraints.c:4638 2 | void f() { __sync_bool_compare_and_swap(a, -8, 0); } | ^ 0xb7d9b4 curr_insn_transform /home/alecop01/toolchain/src/gcc/gcc/lra-constraints.c:4638 0xb7ea1b lra_constraints(bool) /home/alecop01/toolchain/src/gcc/gcc/lra-constraints.c:5169 0xb65c5c lra(_IO_FILE*) /home/alecop01/toolchain/src/gcc/gcc/lra.c:2336 0xb1781c do_reload /home/alecop01/toolchain/src/gcc/gcc/ira.c:5835 0xb1781c execute /home/alecop01/toolchain/src/gcc/gcc/ira.c:6021 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See for instructions.=