On Fri, Jun 09, 2023 at 11:06:04AM +0200, Richard Biener via Gcc-patches wrote: > On Fri, Jun 9, 2023 at 3:48 AM Andrew Pinski via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > So for the attached testcase, we assumed that zero_one_valued_p would > > be the value [0,1] but currently zero_one_valued_p matches also > > signed 1 bit integers. > > This changes that not to match that and fixes the 2 new testcases at > > all optimization levels. > > > > OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. > > OK.
Note, this means it won't return true for zero INTEGER_CSTs with signed 1-bit precision type. Such value is in the [0, 1] range. Though, I guess signed 1-bit precision types are so rare and problematic that it doesn't hurt not to optimize that. Jakub