aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorBrad Lucier <lucier@math.purdue.edu>2002-10-19 23:03:21 +0000
committerRichard Henderson <rth@gcc.gnu.org>2002-10-19 16:03:21 -0700
commit433d5d04bc405d51ebff7f14e4cbad9f3f88412a (patch)
tree97436f018f49752a110be35cf0d595020c56cca8 /gcc
parent1194ca059028a55c9026606e5a73c0e01cd060cb (diff)
downloadgcc-433d5d04bc405d51ebff7f14e4cbad9f3f88412a.zip
gcc-433d5d04bc405d51ebff7f14e4cbad9f3f88412a.tar.gz
gcc-433d5d04bc405d51ebff7f14e4cbad9f3f88412a.tar.bz2
real.c (do_add): Fix 0+0 sign corner case.
* real.c (do_add): Fix 0+0 sign corner case. (do_divide): Fix Inf/0 corner case. From-SVN: r58322
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/real.c8
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a73f5da..06c5603 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-19 Brad Lucier <lucier@math.purdue.edu>
+
+ * real.c (do_add): Fix 0+0 sign corner case.
+ (do_divide): Fix Inf/0 corner case.
+
Sun Oct 20 00:31:31 CEST 2002 Jan Hubicka <jh@suse.cz>
* i386.c (classify_argument): Pass MMX arguments in memory
diff --git a/gcc/real.c b/gcc/real.c
index e9fa342..458a3c6 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -578,8 +578,8 @@ do_add (r, a, b, subtract_p)
switch (CLASS2 (a->class, b->class))
{
case CLASS2 (rvc_zero, rvc_zero):
- /* +-0 +/- +-0 = +0. */
- get_zero (r, 0);
+ /* -0 + -0 = -0, -0 - +0 = -0; all other cases yield +0. */
+ get_zero (r, sign & !subtract_p);
return;
case CLASS2 (rvc_zero, rvc_normal):
@@ -838,8 +838,6 @@ do_divide (r, a, b)
{
case CLASS2 (rvc_zero, rvc_zero):
/* 0 / 0 = NaN. */
- case CLASS2 (rvc_inf, rvc_zero):
- /* Inf / 0 = NaN. */
case CLASS2 (rvc_inf, rvc_inf):
/* Inf / Inf = NaN. */
get_canonical_qnan (r, sign);
@@ -856,6 +854,8 @@ do_divide (r, a, b)
case CLASS2 (rvc_normal, rvc_zero):
/* R / 0 = Inf. */
+ case CLASS2 (rvc_inf, rvc_zero):
+ /* Inf / 0 = Inf. */
get_inf (r, sign);
return;