diff options
author | Alan Modra <amodra@gmail.com> | 2012-10-29 10:17:52 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2012-10-29 10:17:52 +0000 |
commit | 0c5daaa929ca977e105c2c530e0d62b462125bf8 (patch) | |
tree | ce94805ee0b27252104ccde572035fcedab20471 /gas/sb.c | |
parent | ce23608fa264db7678dcd80feddcf3bcb2b82a5e (diff) | |
download | binutils-0c5daaa929ca977e105c2c530e0d62b462125bf8.zip binutils-0c5daaa929ca977e105c2c530e0d62b462125bf8.tar.gz binutils-0c5daaa929ca977e105c2c530e0d62b462125bf8.tar.bz2 |
* sb.c (sb_check): Use __builtin_clzll when size_t is not the
same size as long.
Diffstat (limited to 'gas/sb.c')
-rw-r--r-- | gas/sb.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -137,7 +137,10 @@ sb_check (sb *ptr, size_t len) if ((ssize_t) want < 0) as_fatal ("string buffer overflow"); #if GCC_VERSION >= 3004 - max = (size_t) 1 << (CHAR_BIT * sizeof (want) - __builtin_clzl (want)); + max = (size_t) 1 << (CHAR_BIT * sizeof (want) + - (sizeof (want) <= sizeof (long) + ? __builtin_clzl ((long) want) + : __builtin_clzll ((long long) want))); #else max = 128; while (want > max) |