llvm-project
26f97ee9 - [AArch64] Stop reserved registers from being saved in prolog/epilog (#138448)

Commit
219 days ago
[AArch64] Stop reserved registers from being saved in prolog/epilog (#138448) [GCC's documentation](https://gcc.gnu.org/onlinedocs/gcc-15.1.0/gcc/Code-Gen-Options.html) is clear on how -ffixed-reg must behave: ``` Treat the register named reg as a fixed register; generated code should never refer to it (except perhaps as a stack pointer, frame pointer or in some other fixed role). ``` This implies prolog/epilog code also must not save/restore explicitly fixed registers, even when it is callee-saved. Some projects rely on this (GCC's) behavior. For example, ``` void f() { register uint64_t x28 asm("x28") = 0xee; asm volatile("" : "+r"(x28)); // avoid mov being eliminated } ``` should not touch x28 outside of `mov w28,#0xee`. For riscv64, clang behaves the same as GCC, so I am inclined to believe this is indeed a bug. Fixes #111379.
Author
Parents
Loading