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