aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-03 22:53:46 +0000
committerRichard Stallman <rms@gnu.org>1993-06-03 22:53:46 +0000
commit12194c388f00739381f3c75737275d6a2862cb37 (patch)
treeb4f588c77a815ef5ed2aeba86adbe242ef346f56
parent0a8305859d2da1e7619cfda38dc3e5c45f01b65e (diff)
downloadgcc-12194c388f00739381f3c75737275d6a2862cb37.zip
gcc-12194c388f00739381f3c75737275d6a2862cb37.tar.gz
gcc-12194c388f00739381f3c75737275d6a2862cb37.tar.bz2
(immed_real_const_1): Check explicitly for NaNs.
From-SVN: r4626
-rw-r--r--gcc/varasm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index fea7083..6795444 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -1418,7 +1418,11 @@ immed_real_const_1 (d, mode)
/* Avoid REAL_VALUES_EQUAL here in order to distinguish minus zero. */
if (!bcmp (&dconst0, &d, sizeof d))
return CONST0_RTX (mode);
- else if (REAL_VALUES_EQUAL (dconst1, d))
+ /* Check for NaN first, because some ports (specifically the i386) do not
+ emit correct ieee-fp code by default, and thus will generate a core
+ dump here if we pass a NaN to REAL_VALUES_EQUAL and if REAL_VALUES_EQUAL
+ does a floating point comparison. */
+ else if (! REAL_VALUE_ISNAN (d) && REAL_VALUES_EQUAL (dconst1, d))
return CONST1_RTX (mode);
if (sizeof u == 2 * sizeof (HOST_WIDE_INT))