https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103710
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2021-12-14 Ever confirmed|0 |1 --- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here is another function which should produce the same code: unsigned char fctn1(unsigned int z) noexcept { switch(z) { case 0x0e000000 ... 0x0fffffff: return 1; case 0x60000000 ... 0x67ffffff: return 1; case 0x7c000000 ... 0x7fffffff: return 1; } return 0; } I think GCC produces non-optimial code for all cases even.