aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libgcc/soft-fp/bitint.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libgcc/soft-fp/bitint.h b/libgcc/soft-fp/bitint.h
index cb4d822..07a7bcb 100644
--- a/libgcc/soft-fp/bitint.h
+++ b/libgcc/soft-fp/bitint.h
@@ -276,7 +276,11 @@ bitint_negate (UBILtype *d, const UBILtype *s, SItype n)
} \
if (iprec < 0) \
{ \
- n = sizeof (0ULL) * __CHAR_BIT__ + 1 - __builtin_clzll (~msb);\
+ if (msb == (UBILtype) -1) \
+ n = 1; \
+ else \
+ n = (sizeof (0ULL) * __CHAR_BIT__ + 1 \
+ - __builtin_clzll (~msb)); \
if (BIL_TYPE_SIZE > DI##_BITS && n > DI##_BITS) \
{ \
iv = msb >> (n - DI##_BITS); \