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