aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@bitrange.com>2005-10-30 17:06:40 +0000
committerHans-Peter Nilsson <hp@gcc.gnu.org>2005-10-30 17:06:40 +0000
commite8299ec258037fb73ee906633760ff1191bf05e1 (patch)
tree8ca30322e05d0a7c508e3b7b7d3e7c539c7ced1f /gcc
parent6536905d5af309425d872b1a74fe0b0367675ecf (diff)
downloadgcc-e8299ec258037fb73ee906633760ff1191bf05e1.zip
gcc-e8299ec258037fb73ee906633760ff1191bf05e1.tar.gz
gcc-e8299ec258037fb73ee906633760ff1191bf05e1.tar.bz2
mmix.c (mmix_intval): Correct handling of DFmode constants for hosts with long != 32 bits.
* config/mmix/mmix.c (mmix_intval): Correct handling of DFmode constants for hosts with long != 32 bits. From-SVN: r106027
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mmix/mmix.c20
2 files changed, 12 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index c9bafab..4eb8a40 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2005-10-30 Hans-Peter Nilsson <hp@bitrange.com>
+
+ * config/mmix/mmix.c (mmix_intval): Correct handling of DFmode
+ constants for hosts with long != 32 bits.
+
2005-10-28 Andreas Krebbel <krebbel1@de.ibm.com>
PR middle-end/24093
diff --git a/gcc/config/mmix/mmix.c b/gcc/config/mmix/mmix.c
index 1b5acc4..fc2a5c8 100644
--- a/gcc/config/mmix/mmix.c
+++ b/gcc/config/mmix/mmix.c
@@ -2705,19 +2705,13 @@ mmix_intval (rtx x)
REAL_VALUE_TO_TARGET_DOUBLE (value, bits);
- if (sizeof (long) < sizeof (HOST_WIDEST_INT))
- {
- retval = (unsigned long) bits[1] / 2;
- retval *= 2;
- retval |= (unsigned long) bits[1] & 1;
- retval
- |= (unsigned HOST_WIDEST_INT) bits[0]
- << (sizeof (bits[0]) * 8);
- }
- else
- retval = (unsigned long) bits[1];
-
- return retval;
+ /* The double cast is necessary to avoid getting the long
+ sign-extended to unsigned long long(!) when they're of
+ different size (usually 32-bit hosts). */
+ return
+ ((unsigned HOST_WIDEST_INT) (unsigned long) bits[0]
+ << (unsigned HOST_WIDEST_INT) 32U)
+ | (unsigned HOST_WIDEST_INT) (unsigned long) bits[1];
}
else if (GET_MODE (x) == SFmode)
{