Do not run valgrind on -ffast-math builds

valgrind does not properly handle the Denormals-Are-Zero (DAZ) flag,
which can be set by -ffast-math. That would not generally be a problem
except when the compiler implements sqrt(x) as x*rsqrt(x) with an
exception for x=0. In that case, when x is a non-zero denorm value,
the exception does not trigger with valgrind (but does on real
hardware), which causes the sqrt to evaluate to -inf instead of 0.
This commit is contained in:
Jean-Marc Valin 2025-03-26 14:59:02 -04:00
parent d4494e6ed7
commit e6dd7a3de4
No known key found for this signature in database
GPG key ID: 8D2952BBB52C646D

View file

@ -93,7 +93,7 @@ then
fi
#Run valgrind 5% of the time (minus the asan cases)
if [ "`seq 20 | shuf -n1`" -ne 1 -o "$sanitize" = "-fsanitize=address -fno-sanitize-recover=all" ]
if [ "`seq 20 | shuf -n1`" -ne 1 -o "$sanitize" = "-fsanitize=address -fno-sanitize-recover=all" -o "$math" = "-ffast-math" ]
then
make check > makecheck_output.txt 2>&1
else