From 7cb151c045c2ad9355d4dbfac0ec91a9c3c45eb7 Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 17 Jul 2012 13:49:51 +0000 Subject: hwint.c: Fix loop range. 2012-07-17 Tom de Vries * hwint.c: Fix loop range. From-SVN: r189577 --- gcc/hwint.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'gcc/hwint.c') diff --git a/gcc/hwint.c b/gcc/hwint.c index 024fb7e..b7bcfa5 100644 --- a/gcc/hwint.c +++ b/gcc/hwint.c @@ -113,8 +113,9 @@ int popcount_hwi (unsigned HOST_WIDE_INT x) { int i, ret = 0; + size_t bits = sizeof (x) * CHAR_BIT; - for (i = 0; i < sizeof (x); i += 1) + for (i = 0; i < bits; i += 1) { ret += x & 1; x >>= 1; -- cgit v1.1