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

            Bug ID: 100333
           Summary: arm: ICE (unrecognizable insn) with CMSE nonsecure
                    call and -march=armv8.1-m.main
           Product: gcc
           Version: 12.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 test.c
typedef void __attribute__((cmse_nonsecure_call)) t(void);
t g;
void f() {
  g();
}
$ ./arm-eabi-gcc -c test.c -mcmse -march=armv8.1-m.main -mfloat-abi=soft
test.c: In function 'f':
test.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(call_insn 5 2 0 2 (parallel [
            (call (unspec:SI [
                        (mem:SI (symbol_ref:SI ("g") [flags 0x41]
<function_decl 0x7ffff7059f00 g>) [0 g S4 A32])
                    ] UNSPEC_NONSECURE_MEM)
                (const_int 0 [0]))
            (use (const_int 0 [0]))
            (clobber (reg:SI 14 lr))
        ]) "test.c":4:3 -1
     (nil)
    (nil))
during RTL pass: vregs
test.c:5:1: internal compiler error: in extract_insn, at recog.c:2770
0xcc2347 _fatal_insn(char const*, rtx_def const*, char const*, int, char
const*)
        /home/alecop01/toolchain/src/gcc/gcc/rtl-error.c:108
0xcc2366 _fatal_insn_not_found(rtx_def const*, char const*, int, char const*)
        /home/alecop01/toolchain/src/gcc/gcc/rtl-error.c:116
0xc90fa6 extract_insn(rtx_insn*)
        /home/alecop01/toolchain/src/gcc/gcc/recog.c:2770
0x9b74e4 instantiate_virtual_regs_in_insn
        /home/alecop01/toolchain/src/gcc/gcc/function.c:1658
0x9b74e4 instantiate_virtual_regs
        /home/alecop01/toolchain/src/gcc/gcc/function.c:1983
0x9b74e4 execute
        /home/alecop01/toolchain/src/gcc/gcc/function.c:2032
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.

The ICE does not occur if I instead specify -march=armv8-m.main.

Reply via email to