diff options
author | Jeff Sturm <jsturm@one-point.com> | 2002-01-12 00:01:41 +0000 |
---|---|---|
committer | Jeff Sturm <jsturm@gcc.gnu.org> | 2002-01-12 00:01:41 +0000 |
commit | 0b0d4c5b3ae9aa6a82e08742a542095f193383ea (patch) | |
tree | a1f455e8ed05717a32430e0e4a655f1fa5115c60 /gcc/java/jcf-parse.c | |
parent | a84b4898c1c415bf66f7759eb385384a8676b8df (diff) | |
download | gcc-0b0d4c5b3ae9aa6a82e08742a542095f193383ea.zip gcc-0b0d4c5b3ae9aa6a82e08742a542095f193383ea.tar.gz gcc-0b0d4c5b3ae9aa6a82e08742a542095f193383ea.tar.bz2 |
jcf-parse.c (get_constant): Don't swap lo/hi for big endian targets when HOST_BITS_PER_WIDE_INT >= 64.
* 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
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 2841d5f..4e83b2a 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -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; |