[Bug target/59549] [SH] __builtin_return_address causes push/pop of PR
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59549 --- Comment #2 from Oleg Endo --- Ran over the following in sh.c, maybe it's related: /* For Shcompact, if not optimizing, we end up with a memory reference using the return address pointer for __builtin_return_address even though there is no actual need to put the PR register on the stack. */ pr_live |= df_regs_ever_live_p (RETURN_ADDRESS_POINTER_REGNUM); } /* Force PR to be live if the prologue has to call the SHmedia argument decoder or register saver. */ has_call = pr_live;
[Bug target/59549] [SH] __builtin_return_address causes push/pop of PR
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59549 --- Comment #1 from Oleg Endo olegendo at gcc dot gnu.org --- I haven't checked, but it could be related to this. When shifts are expanded/combined on SH2 (no dynamic shifts), library function calls might be intially inserted but then removed again during combine/split1. If that happens, PR push/pop insns might appear, although a function doesn't contain any function call.