delcypher / fp-benchmarks-imperial

2 stars 3 forks source link

Benchmarks that access fenv should use the `STDC FENV_ACCESS` pragma #17

Open delcypher opened 7 years ago

delcypher commented 7 years ago

Several benchmarks

maybe parts of gsl too (I'm not sure).

access the floating point environment without setting the pragma. This is undefined behaviour and should be fixed.

#pragma STDC FENV_ACCESS ON

Indeed Clang 3.9 at -O3 mis-compiles the interval benchmark.

See https://bugs.llvm.org//show_bug.cgi?id=8100

Note Clang doesn't support this pragma currently.

GCC also miscompiles this benchmark at -O3.

delcypher commented 7 years ago

I've partially fixed this by adding the pragma dfb358710feddd58fd0751c1862a3cc9511a23a2 but Clang doesn't support the pragma and still miscompiles this benchmark.