[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 --- Comment #10 from Andreas Schwab --- Or "other ABI-mandated fixed roles". This also includes return value registers.
[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 --- Comment #9 from Xi Ruoyao --- The easiest way is considering it a documentation issue and do: diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 0870f7aff93..c39880349d5 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -18635,8 +18635,8 @@ more efficient than other code generation strategies. @opindex ffixed @item -ffixed-@var{reg} Treat the register named @var{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). +should never refer to it (except as a stack pointer, frame +pointer, argument register or in some other fixed role). @var{reg} must be the name of a register. The register names accepted are machine-specific and are defined in the @code{REGISTER_NAMES}
[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 --- Comment #8 from gccriscvuser at proton dot me --- Thoughts?
[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 --- Comment #7 from gccriscvuser at proton dot me --- To be clear, when I said "generator is emitting correct code", I mean with respect to the ABI specification. However, this is an actual bug, not a request for enhancement, because the emitted code is incorrect with respect to the command-line option. The programmer has a reasonable expectation that, if no diagnostic is issued, the `-ffixed` command-line option is respected. Thanks
[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 --- Comment #6 from gccriscvuser at proton dot me --- I'm willing to agree that the generator is emitting correct code, but in that case, there should be an error- or fatal-level diagnostic indicating that `-ffixed` is not supported for `a4` (solution 3 above). It would be even better if the diagnostic were issued only if there is at least one function that takes so many parameters that `a4` is needed. The diagnostic message could point at the function(s) themselves to assist the programmer in correcting the issue. If none of the functions use `a4` as a parameter, then no diagnostic is needed.
[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 Xi Ruoyao changed: What|Removed |Added CC||xry111 at gcc dot gnu.org --- Comment #5 from Xi Ruoyao --- Is this a bug? -ffixed-reg 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). To me "the ABI mandates to pass an argument in this register" means "some other fixed role".
[Bug target/109456] `-ffixed` is ignored for `a` registers on RISC-V.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109456 Andrew Pinski changed: What|Removed |Added Component|middle-end |target Keywords|inline-asm | Target||riscv --- Comment #4 from Andrew Pinski --- Anyways this is a target issue when setting up arguments.