summaryrefslogtreecommitdiff
path: root/gcc/config/fp-bit.c
diff options
context:
space:
mode:
authorMichael Meissner <meissner@cygnus.com>1998-06-01 09:15:23 +0000
committerMichael Meissner <meissner@gcc.gnu.org>1998-06-01 09:15:23 +0000
commit9224220fb392bc10bc60e394efc0bdea2c9d515b (patch)
tree2e53603bf495324017727f91a108062107f9c3d4 /gcc/config/fp-bit.c
parent36f5cda04b463beb4e8507f04b647850cdab6b20 (diff)
downloadgcc-9224220fb392bc10bc60e394efc0bdea2c9d515b.tar.gz
Fix IEEE negative zero problems
From-SVN: r20169
Diffstat (limited to 'gcc/config/fp-bit.c')
-rw-r--r--gcc/config/fp-bit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c
index 4ff8e028cc7..ca4e0c5ba28 100644
--- a/gcc/config/fp-bit.c
+++ b/gcc/config/fp-bit.c
@@ -1,7 +1,7 @@
/* This is a software floating point library which can be used instead of
the floating point routines in libgcc1.c for targets without hardware
floating point.
- Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
+ Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
This file is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
@@ -663,6 +663,12 @@ _fpadd_parts (fp_number_type * a,
}
if (iszero (b))
{
+ if (iszero (a))
+ {
+ *tmp = *a;
+ tmp->sign = a->sign & b->sign;
+ return tmp;
+ }
return a;
}
if (iszero (a))
@@ -1028,7 +1034,7 @@ _fpdiv_parts (fp_number_type * a,
if (iszero (b))
{
a->class = CLASS_INFINITY;
- return b;
+ return a;
}
/* Calculate the mantissa by multiplying both 64bit numbers to get a