[Bug tree-optimization/72785] [7 Regression] kernel build error since r236831
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 7 14:21:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to dhowells@redhat.com from comment #13)
> Another possibility, at least for handling ilog2(), could be to provide
> __builtin_ilog2(unsigned long x) as an alternative.
>
> Note that the kernel ilog2() has the property that the result is undefined
> if x==0 (and will jump to ____ilog2_NaN() if x is constant 0).
Ugh, no. Why not just x && (x & -x) == x ? __builtin_ctz (x) : -1
(or ctzl or ctzll depending on what the type is)?
More information about the Gcc-bugs
mailing list