https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116497
--- Comment #20 from andi at firstfloor dot org --- On Tue, Aug 27, 2024 at 05:12:41PM +0000, hjl.tools at gmail dot com wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116497 > > --- Comment #19 from H.J. Lu <hjl.tools at gmail dot com> --- > (In reply to andi from comment #18) > > > > -mgeneral-regs-only works for this case, but breaks SSE. > > > > > > Why is __attribute__((no_caller_saved_registers)) needed on start? > > > > To maintain the standard ABI to its caller. Otherwise the final > > return could clobber caller state. > > GCC should do the right thing without no_caller_saved_registers. If not, > it is a GCC bug. Do you have a testcase to show such GCC bug? The test case is the same, just commenting out SAVE_REGS. You're right. It seems gcc does the right thing based on the callee ABIs. I hadn't realized that. So yes the attribute and the change are not really needed. Good news.
