Source-Changes-HG archive

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

[src/trunk]: src/regress/lib/libc/ieeefp/except deal with imprecise exception...



details:   https://anonhg.NetBSD.org/src/rev/22a73d20dad8
branches:  trunk
changeset: 559891:22a73d20dad8
user:      drochner <drochner%NetBSD.org@localhost>
date:      Thu Mar 25 15:01:22 2004 +0000

description:
deal with imprecise exception handling (on i387):
execute a valid control and non-control operation each
before checking for signal delivery

diffstat:

 regress/lib/libc/ieeefp/except/except.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r ca9497cbe504 -r 22a73d20dad8 regress/lib/libc/ieeefp/except/except.c
--- a/regress/lib/libc/ieeefp/except/except.c   Thu Mar 25 15:00:24 2004 +0000
+++ b/regress/lib/libc/ieeefp/except/except.c   Thu Mar 25 15:01:22 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: except.c,v 1.7 2004/03/25 14:51:28 drochner Exp $      */
+/*     $NetBSD: except.c,v 1.8 2004/03/25 15:01:22 drochner Exp $      */
 
 /*-
  * Copyright (c) 1995 The NetBSD Foundation, Inc.
@@ -129,14 +129,18 @@
                assert(ex1 == ex2);
        }
 
+/* force delayed exceptions to be delivered */
+#define BARRIER() fpsetmask(0); x = one * one
        /*
         * exception unmasked, check SIGFPE delivery and correct siginfo
         */
        for (i = 0; i < sizeof(ops)/sizeof(ops[0]); i++) {
                fpsetmask(ops[i].mask);
                r = sigsetjmp(b, 1);
-               if (!r)
+               if (!r) {
                        (*ops[i].op)();
+                       BARRIER();
+               }
                assert(signal_caught == 1);
                assert(sicode == ops[i].sicode);
                signal_caught = 0;



Home | Main Index | Thread Index | Old Index