summaryrefslogtreecommitdiff
path: root/gcc/ggc-page.c
diff options
context:
space:
mode:
authorSteven Bosscher <stevenb@suse.de>2005-01-16 21:09:24 +0000
committerSteven Bosscher <steven@gcc.gnu.org>2005-01-16 21:09:24 +0000
commit6f0947e4010c96079f97d9ffe9629d5270d816f2 (patch)
tree146a66df19f420ca576e53cd91dfd89894f09879 /gcc/ggc-page.c
parentf53d3f931757427a50c22c4dc54b0f01e290fcbd (diff)
downloadgcc-6f0947e4010c96079f97d9ffe9629d5270d816f2.tar.gz
ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a loop to look for a free slot in a page entry.
* ggc-page.c (ggc_alloc_stat): Use __builtin_ctzl instead of a loop to look for a free slot in a page entry. From-SVN: r93738
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r--gcc/ggc-page.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index e0dfb1610d4..362bfe19763 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -1139,8 +1139,14 @@ ggc_alloc_stat (size_t size MEM_STAT_DECL)
word = bit = 0;
while (~entry->in_use_p[word] == 0)
++word;
+
+#if GCC_VERSION >= 3004
+ bit = __builtin_ctzl (~entry->in_use_p[word]);
+#else
while ((entry->in_use_p[word] >> bit) & 1)
++bit;
+#endif
+
hint = word * HOST_BITS_PER_LONG + bit;
}