This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl #126396 IRIX longdouble infinity issues
authorJarkko Hietaniemi <jhi@iki.fi>
Mon, 19 Oct 2015 02:30:43 +0000 (22:30 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Mon, 19 Oct 2015 13:08:44 +0000 (09:08 -0400)
commit3ec400f5ce53ea1a56d283bc6bf59e75762df058
tree4279c06eaa939e9fcf5c2bec3e752333a104b59d
parentced634a413de975cd30ac5f5d08a1c43d2b402b3
perl #126396 IRIX longdouble infinity issues

In IRIX longdouble (which uses the double-double format, bigendian)
multiplying with infinity introduces garbage bytes to the second double
of the double-double.

This garbage, in turn, seems to tickle another bug in long doubles,
in comparing infinities, where these garbage bytes errorneously matter
when they should not.

Workaround: zero these garbage bytes in multiplication.

The garbage bytes seem to appear only the multiplication, as far as
t/op/infnan.t can detect.

Even though we could place the multiplication result to a temporary NV
variable (for easier infiniteness inspection) for all the platforms and
depend on optimizer doing away with the temporary, let's be conservative.
pp.c