https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94516
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 48230 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48230&action=edit gcc10-pr94516.patch Untested flag to fix the wrong-code issue. The problem was that move2add_note_store didn't handle PRE_MODIFY and POST_MODIFY, but it also seemed misplaced to me, because autoinc doesn't have to appear in a MEM that is stored into, could be also in a MEM that is read from (pop). This doesn't disable the sp += 32; sp -= 8; to sp = r12; sp -= 8; transformation which correct from correctness POV, but actually isn't really beneficial even from size POV, because the csa pass later on optimizes sp += 32; sp -= 8; into sp += 24;, but the latter can't be optimized that way.