+2004-08-16 Andrew Haley <aph@redhat.com>
+
+ * jcf-write.c (find_constant_index): Canonicalize NaNs when
+ generating bytecode.
+
2004-08-16 Elliot Lee <sopwith@redhat.com>
PR java/9677
{
long words[2];
+ /* IEEE NaN can have many values, but the Java VM spec defines a
+ canonical NaN. */
+ if (flag_emit_class_files
+ && REAL_VALUE_ISNAN (TREE_REAL_CST (value)))
+ {
+ if (TYPE_PRECISION (TREE_TYPE (value)) == 32)
+ return find_constant1 (&state->cpool, CONSTANT_Float,
+ 0x7fc00000);
+ else
+ return find_constant2 (&state->cpool, CONSTANT_Double,
+ 0x7ff80000, 0x00000000);
+ }
+
real_to_target (words, &TREE_REAL_CST (value),
TYPE_MODE (TREE_TYPE (value)));
words[0] &= 0xffffffff;