From 737e7965de64b49022c536aaa33a4e0d8de29582 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Thu, 10 Dec 1998 17:21:35 +0000 Subject: 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 --- gcc/real.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'gcc/real.c') 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); + } } -- cgit v1.1