Blame SOURCES/gcc32-java-nan.patch

6f1b0c
2004-08-13  Andrew Haley  <aph@redhat.com>
6f1b0c
6f1b0c
	* jcf-write.c (find_constant_index): Canonicalize NaN.
6f1b0c
6f1b0c
--- gcc/java/jcf-write.c.jj	2002-10-16 22:36:11.000000000 +0100
6f1b0c
+++ gcc/java/jcf-write.c	2004-08-13 17:10:37.000000000 +0100
6f1b0c
@@ -828,12 +828,20 @@
6f1b0c
       long words[2];
6f1b0c
       if (TYPE_PRECISION (TREE_TYPE (value)) == 32)
6f1b0c
 	{
6f1b0c
+	  if (REAL_VALUE_ISNAN (TREE_REAL_CST (value))
6f1b0c
+	      && flag_emit_class_files)
6f1b0c
+	    return find_constant1 (&state->cpool, CONSTANT_Float,
6f1b0c
+				   0x7fc00000);
6f1b0c
 	  words[0] = etarsingle (TREE_REAL_CST (value)) & 0xFFFFFFFF;
6f1b0c
 	  return find_constant1 (&state->cpool, CONSTANT_Float, 
6f1b0c
 				 (jword)words[0]);
6f1b0c
 	}
6f1b0c
       else
6f1b0c
 	{
6f1b0c
+	  if (REAL_VALUE_ISNAN (TREE_REAL_CST (value))
6f1b0c
+	      && flag_emit_class_files)
6f1b0c
+	    return find_constant2 (&state->cpool, CONSTANT_Double,
6f1b0c
+				   0x7ff80000, 0x00000000);
6f1b0c
 	  etardouble (TREE_REAL_CST (value), words);
6f1b0c
 	  return find_constant2 (&state->cpool, CONSTANT_Double,
6f1b0c
 				 (jword)(words[1-FLOAT_WORDS_BIG_ENDIAN] &