public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/99977] New: arm: ICE with __sync_bool_compare_and_swap and -mcpu=cortex-m23
@ 2021-04-08 16:54 acoplan at gcc dot gnu.org
  2021-04-08 16:55 ` [Bug target/99977] " acoplan at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: acoplan at gcc dot gnu.org @ 2021-04-08 16:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99977

            Bug ID: 99977
           Summary: arm: ICE with __sync_bool_compare_and_swap and
                    -mcpu=cortex-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=cortex-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:2671
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 <https://gcc.gnu.org/bugs/> 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=cortex-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 <https://gcc.gnu.org/bugs/> for instructions.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-04-06 10:19 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-08 16:54 [Bug target/99977] New: arm: ICE with __sync_bool_compare_and_swap and -mcpu=cortex-m23 acoplan at gcc dot gnu.org
2021-04-08 16:55 ` [Bug target/99977] " acoplan at gcc dot gnu.org
2021-04-08 18:06 ` jakub at gcc dot gnu.org
2021-04-09  8:59 ` acoplan at gcc dot gnu.org
2021-04-27 13:57 ` cvs-commit at gcc dot gnu.org
2021-04-27 14:28 ` acoplan at gcc dot gnu.org
2021-05-17 16:35 ` cvs-commit at gcc dot gnu.org
2021-05-19 14:46 ` cvs-commit at gcc dot gnu.org
2021-05-19 14:47 ` cvs-commit at gcc dot gnu.org
2021-05-20 12:40 ` cvs-commit at gcc dot gnu.org
2022-04-06 10:18 ` cvs-commit at gcc dot gnu.org
2022-04-06 10:19 ` acoplan at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).