https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105253
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> --- We're not checking for an optab here (that's on purpose IIRC). The code using the niter analysis result is responsible to do cost checking. The builtin is recognized via number_of_iterations_popcount. If you use GCC you have to link against libgcc.a at least.