https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72742
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |jakub at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Created attachment 40289 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40289&action=edit gcc7-pr72742.patch Untested fix. From my limited understanding, rs6000.md has *and<mode>3_imm_dot/*and<mode>3_imm_dot2 patterns which test that the immediate is not rs6000_is_valid_and_mask, clobber also "x" if they don't have "x" as destination and are split into *and<mode>3_imm followed by comparison. And then there are very similar *and<mode>3_imm_mask_dot/*and<mode>3_imm_mask_dot2 patterns that don't clobber "x" even if they don't have "x" as destination and are split into the *and<mode>3_mask pattern which doesn't clobber "x". But, for this to work, the immediate has to be a valid mask. I bet for -mno-lra it happened to work because the first patterns were picked up if the constants weren't valid masks. The patch just tightens up the second patterns so that even LRA knows they should not be used it the immediate is not a valid mask.