https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119971
--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> --- So there's two ways I see to fix this. One would be to eliminate the pattern that I showed in c#2. That would result in a minor code quality regression in some cases and after a ton of thought I think that pattern is fine in isolation as well. It's really the interaction between the pattern mentioned in c#1 and c#2 that's the problem. The pattern in c#1 eliminates the explicit masking in the split code. That in turn interacts badly with the second pattern. So basically what Pinski said in his comment :-) Thankfully looking at Jivan's patterns for the first time in a year or so I realize they don't need to be a define_insn_and_split. They can just be a simple define_insn. That in turn avoids the split code and keeps the explicit masking in the RTL. That should be enough to fix his problem. I'll need to do a walk through the md files to see if there's similar cases lurking.