https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104971
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 52650 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52650&action=edit gcc12-pr104971.patch Here is untested patch with the optimization not to expand the pushf/pop at all if we don't need the result. Though, the LRA bug will remain latent with it and should be fixed anyway.