https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120031
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- There is CTZ detection in tree-ssa-forwprop.cc already which checks for this very same pattern I think - optimize_count_trailing_zeroes, but that is confused by the sign conversion from the - (int) val, it expects -val only.