/* { dg-do run { target { stdint_types } } } */ #include #include void f(uint64_t *a, uint64_t aa) __attribute__((noinline)); void f(uint64_t *a, uint64_t aa) { uint64_t new_value = aa; uint64_t old_value = *a; int bit_size = 32; uint64_t mask = (uint64_t)(unsigned)(-1); uint64_t tmp = old_value & mask; new_value &= mask; /* On overflow we need to add 1 in the upper bits */ if (tmp > new_value) new_value += 1ull<