This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/72785] [7 Regression] kernel build error since r236831
- From: "dhowells at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 07 Nov 2016 15:26:46 +0000
- Subject: [Bug tree-optimization/72785] [7 Regression] kernel build error since r236831
- Auto-submitted: auto-generated
- References: <bug-72785-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785
--- Comment #16 from dhowells at redhat dot com <dhowells at redhat dot com> ---
I guess the following could be used:
int clz_ilog2(unsigned long x)
{
return __builtin_clz(x);
}
which compiles to:
0000000000000027 <clz_ilog2>:
27: 0f bd c7 bsr %edi,%eax
2a: 83 f0 1f xor $0x1f,%eax
2d: c3 retq
though the XOR is superfluous - for any valid input to ilog2(), I think the
output is always in the range 0-31.