https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87944
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Target Milestone|--- |14.0 Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED --- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- (In reply to Mikael Pettersson from comment #5) > Appears to have been fixed for gcc-14.0 by > > 30038a207c10a2783fa2695b62c7c8458ef05e73 is the first new commit > commit 30038a207c10a2783fa2695b62c7c8458ef05e73 > Author: Vladimir N. Makarov <vmaka...@redhat.com> > Date: Tue May 30 15:54:28 2023 -0400 > > LRA: Update insn sp offset if its input reload changes SP > > which mentions a problem switching the h8300 to lra, but there's no PR > reference in either the commit message or the mailing-list post. https://gcc.gnu.org/pipermail/gcc-patches/2023-May/620128.html This is definitely the fix here. In this case we had: (insn 12 10 13 2 (set (mem/f:HI (pre_dec:HI (reg/f:HI 6 sp)) [1 S2 A16]) (reg/f:HI 24)) "../../testarg.c":9:12 25 {movhi} (expr_list:REG_DEAD (reg/f:HI 24) (expr_list:REG_ARGS_SIZE (const_int 2 [0x2]) (nil)))) Which then would turn into incorrectly what is described in both the bug report here and in fact the same as what is described in the email.