New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PATCH] fix op/infnan.t test fails with NAN conversion on VC 6 #15146
Comments
From @bulk88Created by @bulk88See branch Perl Info
|
From @bulk88patch attached -- |
From @bulk880001-fix-op-infnan.t-test-fails-with-NAN-conversion-on-VC.patchFrom 2b5a9d56c889e956e7b6a75cc8fac49afdaf61f6 Mon Sep 17 00:00:00 2001
From: Daniel Dragan <bulk88@hotmail.com>
Date: Tue, 26 Jan 2016 02:27:49 -0500
Subject: [PATCH] fix op/infnan.t test fails with NAN conversion on VC 6
fixes
ok 443 - NAN is NaN numerically (by not being NaN)
ok 444 - NAN value stringifies as NaN
ok 445 - nan is NaN numerically (by not being NaN)
not ok 446 - nan value stringifies as NaN
ok 447 - qnan is NaN numerically (by not being NaN)
not ok 448 - qnan value stringifies as NaN
ok 449 - SNAN is NaN numerically (by not being NaN)
not ok 450 - SNAN value stringifies as NaN
ok 451 - NanQ is NaN numerically (by not being NaN)
not ok 452 - NanQ value stringifies as NaN
ok 453 - NANS is NaN numerically (by not being NaN)
not ok 454 - NANS value stringifies as NaN
ok 455 - 1.\#QNAN is NaN numerically (by not being NaN)
not ok 456 - 1.\#QNAN value stringifies as NaN
ok 457 - +1\#SNAN is NaN numerically (by not being NaN)
not ok 458 - +1\#SNAN value stringifies as NaN
ok 459 - -1.\#NAN is NaN numerically (by not being NaN)
not ok 460 - -1.\#NAN value stringifies as NaN
ok 461 - 1\#IND is NaN numerically (by not being NaN)
not ok 462 - 1\#IND value stringifies as NaN
ok 463 - 1.\#IND00 is NaN numerically (by not being NaN)
not ok 464 - 1.\#IND00 value stringifies as NaN
ok 465 - NAN(123) is NaN numerically (by not being NaN)
not ok 466 - NAN(123) value stringifies as NaN
ok 467 - NaN is not lt zero
ok 468 - NaN is not == zero
ok 469 - NaN is not gt zero
ok 470 - NaN is not lt NaN
ok 471 - NaN is not gt NaN
Caused by commit 230ee21f3e from ~5.23.5. Add special casing for VC6.
The NV to IV casts on VC are a function call called __ftol, skip executing
the NV to IV casts if the logic test tests will follow "TARGn" branch
because the NV and IV values are !=.
---
pp.c | 22 ++++++++++++++++------
pp_hot.c | 11 ++++++++---
2 files changed, 24 insertions(+), 9 deletions(-)
diff --git a/pp.c b/pp.c
index 016023e..885ec84 100644
--- a/pp.c
+++ b/pp.c
@@ -1364,9 +1364,14 @@ PP(pp_multiply)
NV nr = SvNVX(svr);
NV result;
- il = (IV)nl;
- ir = (IV)nr;
- if (nl == (NV)il && nr == (NV)ir)
+ if (
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+ !Perl_isnan(nl) && nl == (NV)(il = (IV)nl)
+ && !Perl_isnan(nr) && nr == (NV)(ir = (IV)nr)
+#else
+ nl == (NV)(il = (IV)nl) && nr == (NV)(ir = (IV)nr)
+#endif
+ )
/* nothing was lost by converting to IVs */
goto do_iv;
SP--;
@@ -1940,9 +1945,14 @@ PP(pp_subtract)
NV nl = SvNVX(svl);
NV nr = SvNVX(svr);
- il = (IV)nl;
- ir = (IV)nr;
- if (nl == (NV)il && nr == (NV)ir)
+ if (
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+ !Perl_isnan(nl) && nl == (NV)(il = (IV)nl)
+ && !Perl_isnan(nr) && nr == (NV)(ir = (IV)nr)
+#else
+ nl == (NV)(il = (IV)nl) && nr == (NV)(ir = (IV)nr)
+#endif
+ )
/* nothing was lost by converting to IVs */
goto do_iv;
SP--;
diff --git a/pp_hot.c b/pp_hot.c
index b80efae..986367c 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -624,9 +624,14 @@ PP(pp_add)
NV nl = SvNVX(svl);
NV nr = SvNVX(svr);
- il = (IV)nl;
- ir = (IV)nr;
- if (nl == (NV)il && nr == (NV)ir)
+ if (
+#if defined(NAN_COMPARE_BROKEN) && defined(Perl_isnan)
+ !Perl_isnan(nl) && nl == (NV)(il = (IV)nl)
+ && !Perl_isnan(nr) && nr == (NV)(ir = (IV)nr)
+#else
+ nl == (NV)(il = (IV)nl) && nr == (NV)(ir = (IV)nr)
+#endif
+ )
/* nothing was lost by converting to IVs */
goto do_iv;
SP--;
--
1.7.9.msysgit.0
|
From @steve-m-hayOn Tue Jan 26 15:42:11 2016, bulk88 wrote:
Thanks, applied in 3336af0. |
The RT System itself - Status changed from 'new' to 'open' |
@steve-m-hay - Status changed from 'open' to 'pending release' |
From @khwilliamsonThank you for submitting this report. You have helped make Perl better. Perl 5.24.0 may be downloaded via https://metacpan.org/release/RJBS/perl-5.24.0 |
@khwilliamson - Status changed from 'pending release' to 'resolved' |
Migrated from rt.perl.org#127372 (status was 'resolved')
Searchable as RT127372$
The text was updated successfully, but these errors were encountered: