diff options
author | jfc <jfc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-04-22 12:57:04 +0000 |
---|---|---|
committer | jfc <jfc@138bc75d-0d04-0410-961f-82ee72b054a4> | 1998-04-22 12:57:04 +0000 |
commit | a0d52dee6fb09feb896b7dc4cff35a4fdbb66eaf (patch) | |
tree | 37289efcae710e9b3892cb4a63490d76a9c2b2c7 /gcc/final.c | |
parent | 650ebf2fef63862bca691a6e0f578b54e8ccbf2f (diff) | |
download | gcc-a0d52dee6fb09feb896b7dc4cff35a4fdbb66eaf.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@19375 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/final.c')
-rw-r--r-- | gcc/final.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/gcc/final.c b/gcc/final.c index 038de928be9..393da70adeb 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; |