The code can shift the 1ULL for value larger than 32 depending of
the exponent value. Building with ubsan triggers:
$ math/test-ldouble-setpayload
testing long double (without inline functions)
UBSAN: Undefined behaviour in ../sysdeps/ieee754/ldbl-96/s_setpayloadl_main.c:48:32 shift exponent 16414 is too large for 32-bit type 'unsigned int'
int shift = BIAS + EXPLICIT_MANT_DIG - exponent;
if (shift < 32
? (lx & ((1U << shift) - 1)) != 0
- : (lx != 0 || (hx & ((1U << (shift - 32)) - 1)) != 0))
+ : shift < 64 ? (lx != 0 || (hx & ((1U << (shift - 32)) - 1)) != 0)
+ : 0)
{
SET_LDOUBLE_WORDS (*x, 0, 0, 0);
return 1;