[PATCH] Use __builtin_popcount in __sched_cpucount [BZ #21696]

H.J. Lu hjl.tools@gmail.com
Sat Jul 1 14:31:00 GMT 2017


On Sat, Jul 1, 2017 at 7:26 AM, Florian Weimer <fweimer@redhat.com> wrote:
> On 07/01/2017 04:12 PM, H.J. Lu wrote:
>> posix/sched_cpucount.c assumes that size of __cpu_mask == size of long,
>> which is incorrect for x32.  This patch uses __builtin_popcount, which
>> is availabe in GCC 4.9, in posix/sched_cpucount.c.
>>
>> Tested on i686, x86-64 and x32 with multi-arch disabled.
>>
>> 2017-07-01  Florian Weimer  <fweimer@redhat.com>
>>           H.J. Lu  <hongjiu.lu@intel.com>
>>
>>       [BZ #21696]
>>       * posix/sched_cpucount.c: Don't include <limits.h>.
>>       (__sched_cpucount): Use __builtin_popcount.
>
> Patch looks good to me.  Thanks.
>

Checked it in.

Thanks.


-- 
H.J.



More information about the Libc-alpha mailing list