-#define COUNT_ONE_BITS(BUILTIN, TYPE) \
- int count = count_one_bits_32 (x); \
- if (CHAR_BIT * sizeof (TYPE) > 32) \
- count += count_one_bits_32 (x >> 31 >> 1); \
- (void) verify_true (CHAR_BIT * sizeof (TYPE) <= 64); \
+#define COUNT_ONE_BITS(BUILTIN, TYPE) \
+ /* This condition is written so as to avoid shifting by more than \
+ 31 bits at once, and also avoids a random HP-UX cc bug. */ \
+ verify (((TYPE) -1 >> 31 >> 31 >> 2) == 0); /* TYPE has at most 64 bits */ \
+ int count = count_one_bits_32 (x); \
+ if (1 < (TYPE) -1 >> 31) /* TYPE has more than 32 bits? */ \
+ count += count_one_bits_32 (x >> 31 >> 1); \