test failure on alpha, volume-test failing due to a floating-point exception
Forwarded from https://bugs.debian.org/916504
Michael Cree:
Pulseaudio FTBFS on alpha due to the volume-test test failing due to a floating-point exception which in turn is due to an infinity in floating-point calculations when volume-test is compiled with finite math options.
This is bug Debian#798248 reappearing but in a subtlely different guise. There the non-finite math was protected against by checking that the arguments are finite before performing floating point calculations, but it now seems that gcc takes the specification of finite math, being "[a]llow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs" so pedantically true, that it is fair game to optimise away any calls to isfinite() because the argument must be finite: it was said so on the command line!
Whatever, examination of the object code shows that the calls to isfinite() are eliminated thus the floating-point arithmetic is no longer protected.
Fortunately we can work out whether the arguments to the offending arithmetic are finite by other means and I attach a patch doing just that. With this patch pulseaudio builds to completion on Alpha.
However, I think that since the volume might sensibly be -infinity when converted to dB, using -ffast-math
is wrong. I'm not sure, however, so I seek upstream advice on this.