http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50257
--- Comment #12 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-09-06 09:39:47 UTC --- Thanks Jakub, for now we'd rather keep the library __builtin_constant_p-free (a couple of weeks ago we had fun with Marc Glisse recollecting all the flames on the mailing list the last time somebody tried to add one elsewhere ;) Really, I think here most of the improvement performance-wise comes from not calling the out-of-line lower_bound on the whole __prime_list (normally in the profile the malloc call is much higher) thus I say let's delay for now further optimization for constant values (would be 0 and 10, I guess),