https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94802
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |easyhack, | |missed-optimization Last reconfirmed| |2020-04-27 CC| |jakub at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- For the first one, guess __builtin_clz (x) == 0 can be transformed into (int) x < 0 and similarly __builtin_clz (x) != 0 to (int) x >= 0. Not sure if we should check CLZ_DEFINED_VALUE_AT_ZERO if it isn't 0 (or precision-1) for these transformations, while the documentation says that the builtin is undefined at zero, e.g. if CLZ_DEFINED_VALUE_AT_ZERO returns 2 then even at GIMPLE the == 0 guard for it could have been optimized away already.