jcf-parse.c (get_constant): Don't swap lo/hi for big endian targets when HOST_BITS_PE...
authorJeff Sturm <jsturm@one-point.com>
Sat, 12 Jan 2002 00:01:41 +0000 (00:01 +0000)
committerJeff Sturm <jsturm@gcc.gnu.org>
Sat, 12 Jan 2002 00:01:41 +0000 (00:01 +0000)
* jcf-parse.c (get_constant): Don't swap lo/hi for big
endian targets when HOST_BITS_PER_WIDE_INT >= 64.

Co-Authored-By: Martin Kahlert <martin.kahlert@infineon.com>
From-SVN: r48786

gcc/java/ChangeLog
gcc/java/jcf-parse.c

index cc8c4059b6ccf6c2fa5b13299428ac28fdd781e7..ed8078c415cc5402c37de43fbcfd8703929746c0 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-10  Jeff Sturm  <jsturm@one-point.com>
+            Martin Kahlert  <martin.kahlert@infineon.com>
+
+       * jcf-parse.c (get_constant): Don't swap lo/hi for big
+       endian targets when HOST_BITS_PER_WIDE_INT >= 64.
+
 2002-01-03  Graham Stott  <grahams@redhat.com>
 
         * class.c (compile_resource_file): Update copyright date.
index 2841d5f5f8464a92112ab0ac191d6c9c904e34ef..4e83b2ab2f611f661bb78059d0f942ca20dea628 100644 (file)
@@ -326,7 +326,15 @@ get_constant (jcf, index)
        lshift_double (num[0], 0, 32, 64, &lo, &hi, 0);
        num[0] = JPOOL_INT (jcf, index+1);
        add_double (lo, hi, num[0], 0, &lo, &hi);
-       if (FLOAT_WORDS_BIG_ENDIAN)
+
+       /* Since ereal_from_double expects an array of HOST_WIDE_INT
+          in the target's format, we swap the elements for big endian
+          targets, unless HOST_WIDE_INT is sufficiently large to
+          contain a target double, in which case the 2nd element
+          is ignored.
+
+          FIXME: Is this always right for cross targets? */
+       if (FLOAT_WORDS_BIG_ENDIAN && sizeof(num[0]) < 8)
          {
            num[0] = hi;
            num[1] = lo;