https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106888
--- Comment #6 from Jeffrey A. Law <law at gcc dot gnu.org> --- Comment on attachment 54905 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54905 proposed patch So that's a subset of what we've done. We initially thought that was going to be enough to solve this class of problems. But it's actually deeper than just having a zero_extension variant of this pattern. I'll officially submit the zero_extension pattern and the match.pd bits. The other pattern we wrote is fugly and I'd like to look at it one more time.