This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
[gcjx] Patch: FYI: fix handling of double literals
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 10 Oct 2005 18:14:45 -0600
- Subject: [gcjx] Patch: FYI: fix handling of double literals
- Reply-to: tromey at redhat dot com
I'm checking this in on the gcjx branch.
This fixes the handling of double literals on little endian machines.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* tree.cc (handle_double): Swap words on little endian machines.
Index: tree.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/tree.cc,v
retrieving revision 1.1.2.57
diff -u -r1.1.2.57 tree.cc
--- tree.cc 10 Oct 2005 20:22:47 -0000 1.1.2.57
+++ tree.cc 11 Oct 2005 00:20:19 -0000
@@ -2110,8 +2110,13 @@
jint w[2];
double_to_words (w, val);
long wl[2];
+#ifdef WORDS_BIGENDIAN
wl[0] = w[0];
wl[1] = w[1];
+#else
+ wl[0] = w[1];
+ wl[1] = w[0];
+#endif // WORDS_BIGENDIAN
REAL_VALUE_TYPE d;
real_from_target_fmt (&d, wl, &ieee_double_format);
return build_real (type_jdouble, d);