diff options
author | Jim Wilson <wilson@cygnus.com> | 1999-02-10 17:28:24 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1999-02-10 09:28:24 -0800 |
commit | b5a3eb844512505aed41fb3a0cb4e3f45c082589 (patch) | |
tree | 893f28e5cc7f90ccdec4e2184b9e0139d7125f68 /gcc/final.c | |
parent | 01dd4564b6358bed9004a3f8daa41234d1555108 (diff) | |
download | gcc-b5a3eb844512505aed41fb3a0cb4e3f45c082589.zip gcc-b5a3eb844512505aed41fb3a0cb4e3f45c082589.tar.gz gcc-b5a3eb844512505aed41fb3a0cb4e3f45c082589.tar.bz2 |
Fix 64b-x-32b cross compiler breakage. Make alpha-x-m32r work again.
* emit-rtl.c (operand_subword): Sign extend REAL_VALUE_TO_TARGET_SINGLE
result.
* final.c (split_double): Sign extend REAL_VALUE_TO_TARGET_DOUBLE
result.
* real.c (endian): Delete sign extension code.
* config/m32r/m32r.md (movsf_insn+1): REAL_VALUE_TO_TARGET_SINGLE call
replaced with operand_subword call.
From-SVN: r25140
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/final.c b/gcc/final.c index 74c36c2..602c278 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -3929,6 +3929,22 @@ split_double (value, first, second) not necessarily BITS_PER_WORD bits. */ REAL_VALUE_TO_TARGET_DOUBLE (r, l); + /* If 32 bits is an entire word for the target, but not for the host, + then sign-extend on the host so that the number will look the same + way on the host that it would on the target. See for instance + simplify_unary_operation. The #if is needed to avoid compiler + warnings. */ + +#if HOST_BITS_PER_LONG > 32 + if (BITS_PER_WORD < HOST_BITS_PER_LONG && BITS_PER_WORD == 32) + { + if (l[0] & ((long) 1 << 31)) + l[0] |= ((long) (-1) << 32); + if (l[1] & ((long) 1 << 31)) + l[1] |= ((long) (-1) << 32); + } +#endif + *first = GEN_INT ((HOST_WIDE_INT) l[0]); *second = GEN_INT ((HOST_WIDE_INT) l[1]); #else |