https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97445
--- Comment #39 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Christophe Leroy from comment #38) > But on powerpc that's already the case and it doesn't solve the issue. > > static inline int fls(unsigned int x) > { > return 32 - __builtin_clz(x); > } > > static inline int fls64(__u64 x) > { > return 64 - __builtin_clzll(x); > } That is clearly a kernel bug (__builtin_clz* is documented undefined for 0, while fls* wants to be well defined there), and shouldn't change anything, because in the if (__builtin_constant_p (size)) case get_order doesn't use fls*, but ilog2. And it is ilog2 that should be changed.