[Bug c/109456] `-ffixed` is ignored for `a` registers on RISC-V.
gccriscvuser at proton dot me
gcc-bugzilla@gcc.gnu.org
Sun Apr 9 15:33:53 GMT 2023
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456
--- Comment #1 from gccriscvuser at proton dot me ---
Corrected URLs from original description:
Register `a4` is normally used for passing parameters in a call.
https://github.com/riscv-non-isa/riscv-elf-psabi-doc/blob/master/riscv-cc.adoc
As such, it would be problematic to use `a4` for a global as shown here.
https://gcc.gnu.org/onlinedocs/gcc/Global-Register-Variables.html
However, if this code is compiled with `-ffixed-a4`, then `a4` should be
reserved for this global register variable.
https://gcc.gnu.org/onlinedocs/gcc/Code-Gen-Options.html
More information about the Gcc-bugs
mailing list