diff options
author | Tom de Vries <tom@codesourcery.com> | 2012-07-17 13:49:51 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2012-07-17 13:49:51 +0000 |
commit | 7cb151c045c2ad9355d4dbfac0ec91a9c3c45eb7 (patch) | |
tree | 1796522313c65f2e0f0950f67dccbc2f890be634 /gcc/hwint.c | |
parent | 440b6d590a8565358b3d603e27af8bd7db3fa27a (diff) | |
download | gcc-7cb151c045c2ad9355d4dbfac0ec91a9c3c45eb7.tar.gz |
hwint.c: Fix loop range.
2012-07-17 Tom de Vries <tom@codesourcery.com>
* hwint.c: Fix loop range.
From-SVN: r189577
Diffstat (limited to 'gcc/hwint.c')
-rw-r--r-- | gcc/hwint.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/hwint.c b/gcc/hwint.c index 024fb7e36e3..b7bcfa59740 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; |