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

Florian Weimer fweimer@redhat.com
Sat Jul 1 14:26:00 GMT 2017


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.

Florian



More information about the Libc-alpha mailing list