[Bug tree-optimization/93682] Wrong optimization: on x87 -fexcess-precision=standard is incompatible with -mpc64
ch3root at openwall dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 11 16:38:00 GMT 2020
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93682
--- Comment #1 from Alexander Cherepanov <ch3root at openwall dot com> ---
The instability can also taint surrounding code which leads to nonsense:
----------------------------------------------------------------------
#include <stdio.h>
__attribute__((noipa)) // imagine it in a separate TU
static long double opaque(long double d) { return d; }
int main()
{
int one = opaque(1);
long double x = opaque(1);
int a = x + 0x1p-60 == 1;
opaque(a);
if (one == a) {
opaque(0);
if (x == 1) {
opaque(0);
if (a == 0) {
opaque(0);
if (one == 0)
printf("one = %d\n", one);
}
}
}
}
----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -m32 -march=i686 -mpc64 -O3 test.c &&
./a.out
one = 0
----------------------------------------------------------------------
gcc x86-64 version: gcc (GCC) 10.0.1 20200211 (experimental)
----------------------------------------------------------------------
More information about the Gcc-bugs
mailing list