https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127482
--- Comment #4 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Georg-Johann Lay <[email protected]>: https://gcc.gnu.org/g:6ffc1509faea719d0271d0123f0529c51bc7ee95 commit r14-12920-g6ffc1509faea719d0271d0123f0529c51bc7ee95 Author: Georg-Johann Lay <[email protected]> Date: Mon Oct 5 17:16:50 2026 +0200 AVR: target/127482 - Fix prologue_saves + noreturn wrong code This patch fixes wrong code when a noreturn function is compiled with -mcall-prologues and the function gets arguments on the stack. The bug is that prologue_saves saves more registers than calculated by avr_regs_to_save() so that the argument pointer is wrong. The fix is to behave like avr_regs_to_save(), i.e. don't save any regs in a noreturn function so that prologue_saves is not used. PR target/127482 gcc/ * config/avr/avr.cc (sequent_regs_live): Return 0 for noreturn functions, OS_task and OS_main. (avr_prologue_setup_frame, avr_expand_epilogue) <minimize>: Move OS_task and OS_main tests to sequent_regs_live. gcc/testsuite/ * gcc.target/avr/torture/pr127482.c: New test. (cherry picked from commit a3028a9ab546ca16147d927eeb765b35b6956c2f)
