https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116772
--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 59143 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=59143&action=edit Better reduced testcase Here is a better reduced testcase. The problem only shows up with these 2 patterns because in: a != 0 ? a * b : 0 a != 0 ? a & b : 0 b is only conditionaly used.