From c211b99198b0a7d1664eaa4439eaf021cf5a28a3 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Mon, 19 Dec 1994 12:48:30 -0800 Subject: (fpadd_parts): Adding infinities with opposite signs yields a NaN. From-SVN: r8667 --- gcc/config/fp-bit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gcc') diff --git a/gcc/config/fp-bit.c b/gcc/config/fp-bit.c index 373c251..9f2d279 100644 --- a/gcc/config/fp-bit.c +++ b/gcc/config/fp-bit.c @@ -485,6 +485,9 @@ _fpadd_parts (fp_number_type * a, } if (isinf (a)) { + /* Adding infinities with opposite signs yields a NaN. */ + if (isinf (b) && a->sign != b->sign) + return nan (); return a; } if (isinf (b)) -- cgit v1.1