diff options
author | Alexandre Oliva <aoliva@redhat.com> | 2001-01-30 22:27:44 +0000 |
---|---|---|
committer | Alexandre Oliva <aoliva@gcc.gnu.org> | 2001-01-30 22:27:44 +0000 |
commit | 48b4d9013aea77920fae83d3d5103f67023605e2 (patch) | |
tree | 983c1a7912b85c8b1399ed734fd64afee06afddc /gcc/combine.c | |
parent | cab1f90abff5825c2d10bc120c89b68344349505 (diff) | |
download | gcc-48b4d9013aea77920fae83d3d5103f67023605e2.zip gcc-48b4d9013aea77920fae83d3d5103f67023605e2.tar.gz gcc-48b4d9013aea77920fae83d3d5103f67023605e2.tar.bz2 |
combine.c (try_combine): Fix SUBREG setting for HOST_BITS_PER_WIDE_INT >= 2 * BITS_PER_WORD.
* combine.c (try_combine): Fix SUBREG setting for
HOST_BITS_PER_WIDE_INT >= 2 * BITS_PER_WORD.
From-SVN: r39355
Diffstat (limited to 'gcc/combine.c')
-rw-r--r-- | gcc/combine.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index 9b721af..74b02b5 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -1661,9 +1661,32 @@ try_combine (i3, i2, i1, new_direct_jump_p) } if (subreg_lowpart_p (SET_DEST (PATTERN (i3)))) - lo = INTVAL (SET_SRC (PATTERN (i3))); - else + { + /* We don't handle the case of the target word being wider + than a host wide int. */ + if (HOST_BITS_PER_WIDE_INT < BITS_PER_WORD) + abort (); + + lo &= ~(((unsigned HOST_WIDE_INT)1 << BITS_PER_WORD) - 1); + lo |= INTVAL (SET_SRC (PATTERN (i3))); + } + else if (HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) hi = INTVAL (SET_SRC (PATTERN (i3))); + else if (HOST_BITS_PER_WIDE_INT >= 2 * BITS_PER_WORD) + { + int sign = -(int) ((unsigned HOST_WIDE_INT) lo + >> (HOST_BITS_PER_WIDE_INT - 1)); + + lo &= ~((((unsigned HOST_WIDE_INT)1 << BITS_PER_WORD) - 1) + << BITS_PER_WORD); + lo |= INTVAL (SET_SRC (PATTERN (i3))) << BITS_PER_WORD; + if (hi == sign) + hi = lo < 0 ? -1 : 0; + } + else + /* We don't handle the case of the higher word not fitting + entirely in either hi or lo. */ + abort (); combine_merges++; subst_insn = i3; |