aboutsummaryrefslogtreecommitdiff
path: root/gcc/final.c
diff options
context:
space:
mode:
authorJohn Carr <jfc@mit.edu>1998-04-22 12:57:04 +0000
committerJohn Carr <jfc@gcc.gnu.org>1998-04-22 12:57:04 +0000
commit27eef9cececccd37254c9106b02fd965369650eb (patch)
tree37289efcae710e9b3892cb4a63490d76a9c2b2c7 /gcc/final.c
parent3f4ea1dee8bf07bf77f7b7417fe77652be421afc (diff)
downloadgcc-27eef9cececccd37254c9106b02fd965369650eb.zip
gcc-27eef9cececccd37254c9106b02fd965369650eb.tar.gz
gcc-27eef9cececccd37254c9106b02fd965369650eb.tar.bz2
emit-rtl.c (gen_highpart): The high part of a CONST_INT is not zero if...
* emit-rtl.c (gen_highpart): The high part of a CONST_INT is not zero if HOST_BITS_PER_WIDE_INT is larger than BITS_PER_WORD. * final.c (split_double): Sign extend both halves of a split CONST_INT. From-SVN: r19375
Diffstat (limited to 'gcc/final.c')
-rw-r--r--gcc/final.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/final.c b/gcc/final.c
index 038de92..393da70 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -3677,16 +3677,12 @@ split_double (value, first, second)
if (HOST_BITS_PER_WIDE_INT >= (2 * BITS_PER_WORD))
{
/* In this case the CONST_INT holds both target words.
- Extract the bits from it into two word-sized pieces. */
+ Extract the bits from it into two word-sized pieces.
+ Sign extend each half to HOST_WIDE_INT. */
rtx low, high;
- HOST_WIDE_INT word_mask;
- /* Avoid warnings for shift count >= BITS_PER_WORD. */
- int shift_count = BITS_PER_WORD - 1;
-
- word_mask = (HOST_WIDE_INT) 1 << shift_count;
- word_mask |= word_mask - 1;
- low = GEN_INT (INTVAL (value) & word_mask);
- high = GEN_INT ((INTVAL (value) >> (shift_count + 1)) & word_mask);
+
+ low = GEN_INT (INTVAL (value) << (HOST_BITS_PER_WIDE_INT - BITS_PER_WORD) >> (HOST_BITS_PER_WIDE_INT - BITS_PER_WORD));
+ high = GEN_INT (INTVAL (value) << (HOST_BITS_PER_WIDE_INT - 2 * BITS_PER_WORD) >> (HOST_BITS_PER_WIDE_INT - BITS_PER_WORD));
if (WORDS_BIG_ENDIAN)
{
*first = high;