Clang 14 and 15 apparently optimizing away code that compiles as expected under Clang 13, ICC, GCC, MSVC

Advertisements I have the following sample code: inline float successor(float f, bool const check) { const unsigned long int mask = 0x7f800000U; unsigned long int i = *(unsigned long int*)&f; if (check) { if ((i & mask) == mask) return f; } i++; return *(float*)&i; } float next1(float a) { return successor(a, true); } float… Read More Clang 14 and 15 apparently optimizing away code that compiles as expected under Clang 13, ICC, GCC, MSVC