[Bug c/121498] RISC-V:The ra register is not pushed onto the stack due to the use of the -fshrink-wrap parameter

lw297073896 at gmail dot com gcc-bugzilla@gcc.gnu.org
Mon Aug 11 08:19:15 GMT 2025


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121498

--- Comment #2 from liu mirko <lw297073896 at gmail dot com> ---
(In reply to Sam James from comment #1)
> Does it happen with -fno-strict-aliasing?

yes,and I used GDB to debug the GCC source code and found that when the
-fshrink-wrap parameter is enabled by default, the function try_shrink_wrapping
(&entry_edge, prologue_seq) adjusts the successor of entry_edge, causing the
position of the prologue insertion to change. Using the -fno-shrink-wrap
parameter to disable this optimization will prevent the issue from occurring.


More information about the Gcc-bugs mailing list