https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124328
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2026-09-01
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> ---
Simple testcase:
int f()
{
register long long x __asm__("r3");
x = 3;
asm("": : "r"(x));
return 0;
}
Compiles fine with clang, but is rejected by GCC for some architectures/ISA
variants (eg. -marm with any armv7+, -march=armv8.1-m.main+mve).
I think this is a bug in the compiler. We shouldn't be rejecting this.
The source of the problem is the code in arm_hard_regno_mode_ok, where we have:
/* We allow almost any value to be stored in the general registers.
Restrict doubleword quantities to even register pairs in ARM state
so that we can use ldrd. The same restriction applies for MVE
in order to support Armv8.1-M Mainline instructions.
Do not allow very large Neon structure opaque modes in general
registers; they would use too many. */
But that's a performance tweak, not a hard requirement, so I think this is
inappropriate at this point.
Nevertheless, we can't just remove this check without working out how to
prevent poor code elsewhere.