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.
NV right = SvNV_nomg(svr);
NV left = SvNV_nomg(svl);
(void)POPs;
+#if defined(__sgi) && defined(USE_LONG_DOUBLE) && LONG_DOUBLEKIND == LONG_DOUBLE_IS_DOUBLEDOUBLE_128_BIT_BIG_ENDIAN && NVSIZE == 16
+ {
+ NV result = left * right;
+ if (Perl_isinf(result)) {
+ Zero((U8*)&result + 8, 8, U8);
+ }
+ SETn( result );
+ }
+#else
SETn( left * right );
+#endif
RETURN;
}
}