https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93681
--- Comment #5 from Vincent Lefèvre <vincent-gcc at vinc17 dot net> ---
Note that this is also reproducible with:
----------------------------------------------------------------------
#include <stdio.h>
__attribute__((noipa,optnone)) // imagine it in a separate TU
static double opaque(double i) { return i; }
int main()
{
int z = opaque(1.0) + 0x1p-60 == 1.0;
printf("z = %d\n", z);
if (z)
puts("z is one");
}
----------------------------------------------------------------------
i.e. where everything has the double type in the tests.
But with a similar program using _Float16 under x86_64 (where one also has
excess precision by default, the evaluation type being float) instead of double
with x87 math, i.e. with
static _Float16 opaque(_Float16 i) { return i; }
and
int z = opaque(1.0f16) + 0x1p-17f16 == 1.0f16;
the issue does not occur (with or without -fexcess-precision=16).
So this seems specific to the x87 excess precision, not a general bug involving
excess precision.