https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128778
Bug ID: 128778
Summary: ICE on ARM with a long long register variable in r12
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: mumumu0722 at gmail dot com
Target Milestone: ---
GCC ICEs ("insn does not satisfy its constraints") when a `long long` local
register variable is placed in r12 and used as an inline asm operand. The value
needs the pair r12:r13, and r13 is SP.
```
long long f(long long v)
{
register long long x __asm__("r12") = v;
__asm__ volatile("" : "+r"(x));
return x;
}
```
$ arm-linux-gnueabihf-gcc -O2 -S test.c
test.c: In function 'f':
test.c:6:1: error: insn does not satisfy its constraints:
6 | }
| ^
(insn 7 6 8 2 (set (reg/v:DI 12 ip [ x ])
(reg:DI 0 r0 [orig:97 v ] [97])) "test.c":3:24 544 {*movdi_vfp}
(nil))
during RTL pass: reload
test.c:6:1: internal compiler error: in extract_constrain_insn, at
recog.cc:2856
Expected: an error, as GCC already gives an error for r14 (whose pair r14:r15
includes PC)
https://godbolt.org/z/6evMvs8P1