https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115494
--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Created attachment 58663 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=58663&action=edit Reduced testcase based on suggestion Reduced testcase based on comment #8. Notes on it, you need a and b be different types so there is a cast for b to anchor the range on it inside the if. The input value of a does not matter in this case as since flag is sets a to 1.