diff options
author | Jim Wilson <wilson@cygnus.com> | 1998-12-10 17:21:35 +0000 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1998-12-10 09:21:35 -0800 |
commit | 737e7965de64b49022c536aaa33a4e0d8de29582 (patch) | |
tree | 8a3b49849a4a07306e6f4b52490a51677d4b2da6 /gcc/real.c | |
parent | ea585788ba7c48bbeec2ed953224a06bb1ebe0ac (diff) | |
download | gcc-737e7965de64b49022c536aaa33a4e0d8de29582.zip gcc-737e7965de64b49022c536aaa33a4e0d8de29582.tar.gz gcc-737e7965de64b49022c536aaa33a4e0d8de29582.tar.bz2 |
Fix alpha-x-m32r-elf bugs.
* cse.c (simplify_unary_operation): Sign-extend constants when
they have the most significant bit set for the target.
* real.c (endian): Sign-extend 32 bit output values on a 64 bit
host.
* m32r/m32r.c (m32r_expand_prologue): Store pretend_size in
HOST_WIDE_INT temporary before negating it.
* m32r/m32r.md (movsi_insn+1): Use ~0xffff instead of 0xffff0000.
From-SVN: r24254
Diffstat (limited to 'gcc/real.c')
-rw-r--r-- | gcc/real.c | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -553,6 +553,20 @@ endian (e, x, mode) abort (); } } + + /* 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. */ + + if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT && BITS_PER_WORD == 32) + { + if (x[0] & ((HOST_WIDE_INT) 1 << 31)) + x[0] |= ((HOST_WIDE_INT) (-1) << 32); + + if (x[1] & ((HOST_WIDE_INT) 1 << 31)) + x[1] |= ((HOST_WIDE_INT) (-1) << 32); + } } |