diff options
author | Roger Sayle <roger@eyesopen.com> | 2002-07-11 01:23:07 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2002-07-11 01:23:07 +0000 |
commit | 0e603223a0b4409a82fe8da8771fc2b0a4e9b7c6 (patch) | |
tree | 7755403fe21485abda2eaeee63211a45a6b4c180 /gcc | |
parent | c5358a5d4619e8a49b44295c70868f2f26a98462 (diff) | |
download | gcc-0e603223a0b4409a82fe8da8771fc2b0a4e9b7c6.zip gcc-0e603223a0b4409a82fe8da8771fc2b0a4e9b7c6.tar.gz gcc-0e603223a0b4409a82fe8da8771fc2b0a4e9b7c6.tar.bz2 |
re PR c/2454 (Test Program A0376972.c fails with gcc-20010320, works with gcc-2.95.3)
PR c/2454
* combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply
to SUBREGs of MEMs. (num_sign_bit_copies): Likewise.
From-SVN: r55386
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/combine.c | 16 |
2 files changed, 15 insertions, 7 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6865e06..b94e96b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,4 +1,10 @@ 2002-07-10 Roger Sayle <roger@eyesopen.com> + + PR c/2454 + * combine.c (nonzero_bits): LOAD_EXTEND_OP should only apply + to SUBREGs of MEMs. (num_sign_bit_copies): Likewise. + +2002-07-10 Roger Sayle <roger@eyesopen.com> Zack Weinberg <zack@codesourcery.com> * builtins.def: Make the argument types of abort and exit diff --git a/gcc/combine.c b/gcc/combine.c index f9d4b40..e7f2255 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -8344,12 +8344,13 @@ nonzero_bits (x, mode) #if defined (WORD_REGISTER_OPERATIONS) && defined (LOAD_EXTEND_OP) /* If this is a typical RISC machine, we only have to worry about the way loads are extended. */ - if (LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND - ? (((nonzero - & (((unsigned HOST_WIDE_INT) 1 - << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1)))) - != 0)) - : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND) + if ((LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND + ? (((nonzero + & (((unsigned HOST_WIDE_INT) 1 + << (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (x))) - 1)))) + != 0)) + : LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) != ZERO_EXTEND) + || GET_CODE (SUBREG_REG (x)) != MEM) #endif { /* On many CISC machines, accessing an object in a wider mode @@ -8572,7 +8573,8 @@ num_sign_bit_copies (x, mode) if ((GET_MODE_SIZE (GET_MODE (x)) > GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))) - && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND) + && LOAD_EXTEND_OP (GET_MODE (SUBREG_REG (x))) == SIGN_EXTEND + && GET_CODE (SUBREG_REG (x)) == MEM) return num_sign_bit_copies (SUBREG_REG (x), mode); #endif #endif |