aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
authorJim Wilson <wilson@cygnus.com>1998-12-10 17:21:35 +0000
committerJim Wilson <wilson@gcc.gnu.org>1998-12-10 09:21:35 -0800
commit737e7965de64b49022c536aaa33a4e0d8de29582 (patch)
tree8a3b49849a4a07306e6f4b52490a51677d4b2da6 /gcc/real.c
parentea585788ba7c48bbeec2ed953224a06bb1ebe0ac (diff)
downloadgcc-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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/real.c b/gcc/real.c
index 7261e29..8cc38cb 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -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);
+ }
}