gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4910-g388ca0a4


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4910-g388ca0a4
Date: Mon, 19 Sep 2022 11:53:52 -0400 (EDT)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.2-stable has been updated
       via  388ca0a4b44f03aa28bc9ce870f50306389f707b (commit)
       via  a3799ae3f5dd6648040d499224cc6dea61b355dd (commit)
      from  8a026763c28ed67f8e195750caf1fe476794282b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=388ca0a4b44f03aa28bc9ce870f50306389f707b

commit 388ca0a4b44f03aa28bc9ce870f50306389f707b
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Mon Sep 19 18:53:31 2022 +0300

    Completely update the ChangeLog.

diff --git a/ChangeLog b/ChangeLog
index d751baf1..da8d51d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,10 @@
 2022-09-19         Arnold D. Robbins     <arnold@skeeve.com>
 
-       * eval.c (fix_nan_sign): New function. See bug list citation
-       in the code.
+       Fix negative NaN issues on RiscV. See bug list citation
+       in the code.  Thanks to Andreas Schwab <schwab@suse.de>
+       for the report.
+
+       * eval.c (fix_nan_sign): New function.
        * interpret.h (r_interpret): Use it for plus and minus cases.
 
 2022-09-16         Arnold D. Robbins     <arnold@skeeve.com>

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=a3799ae3f5dd6648040d499224cc6dea61b355dd

commit a3799ae3f5dd6648040d499224cc6dea61b355dd
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Mon Sep 19 18:51:28 2022 +0300

    Fix negative NaN issue on RiscV.

diff --git a/ChangeLog b/ChangeLog
index 35941d0a..d751baf1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-19         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * eval.c (fix_nan_sign): New function. See bug list citation
+       in the code.
+       * interpret.h (r_interpret): Use it for plus and minus cases.
+
 2022-09-16         Arnold D. Robbins     <arnold@skeeve.com>
 
        * debug.c (do_eval): If a fatal error occurs, don't attempt to
diff --git a/eval.c b/eval.c
index 1069570b..3bfff0ca 100644
--- a/eval.c
+++ b/eval.c
@@ -39,6 +39,8 @@ static int num_exec_hook = 0;
 static Func_pre_exec pre_execute[MAX_EXEC_HOOKS];
 static Func_post_exec post_execute = NULL;
 
+static double fix_nan_sign(double left, double right, double result);
+
 extern void frame_popped();
 
 int OFSlen;
@@ -1901,3 +1903,20 @@ elem_new_to_scalar(NODE *n)
 
        return n;
 }
+
+/* fix_nan_sign --- fix NaN sign on RiscV */
+
+// See the thread starting at
+// https://lists.gnu.org/archive/html/bug-gawk/2022-09/msg00005.html
+// for why we need this function.
+
+static double
+fix_nan_sign(double left, double right, double result)
+{
+       if (isnan(left) && signbit(left))
+               return copysign(result, -1.0);
+       else if (isnan(right) && signbit(right))
+               return copysign(result, -1.0);
+       else
+               return result;
+}
diff --git a/interpret.h b/interpret.h
index 26010ada..955d918f 100644
--- a/interpret.h
+++ b/interpret.h
@@ -583,6 +583,7 @@ uninitialized_scalar:
 plus:
                        t1 = TOP_NUMBER();
                        r = make_number(t1->numbr + x2);
+                       r->numbr = fix_nan_sign(t1->numbr, x2, r->numbr);
                        DEREF(t1);
                        REPLACE(r);
                        break;
@@ -597,6 +598,7 @@ plus:
 minus:
                        t1 = TOP_NUMBER();
                        r = make_number(t1->numbr - x2);
+                       r->numbr = fix_nan_sign(t1->numbr, x2, r->numbr);
                        DEREF(t1);
                        REPLACE(r);
                        break;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog   |  9 +++++++++
 eval.c      | 19 +++++++++++++++++++
 interpret.h |  2 ++
 3 files changed, 30 insertions(+)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]