https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120920
--- Comment #1 from Jeffrey A. Law <law at gcc dot gnu.org> --- This looks fairly painful to capture in a backend pattern; I didn't see any particular attempt by combine that looked like a promising target pattern. I suspect you'll need to look at a simplify-rtx simplification of some kind.