diff options
author | Richard Stallman <rms@gnu.org> | 1993-05-24 07:45:54 +0000 |
---|---|---|
committer | Richard Stallman <rms@gnu.org> | 1993-05-24 07:45:54 +0000 |
commit | 19808e22caa8929ed61043340b832b5c51d4012a (patch) | |
tree | 144a73f1a5aec1bc8835c4c9a3d2f35f19b1888d | |
parent | 87d11e4386cc35cc4b7ad51882e0ba8718e459bb (diff) | |
download | gcc-19808e22caa8929ed61043340b832b5c51d4012a.zip gcc-19808e22caa8929ed61043340b832b5c51d4012a.tar.gz gcc-19808e22caa8929ed61043340b832b5c51d4012a.tar.bz2 |
(subst): For subreg-of-constant, don't gen_lowpart
if it's a big-endian machine and constant is multi-word.
From-SVN: r4554
-rw-r--r-- | gcc/combine.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index ca1567c..49e214e 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3085,8 +3085,16 @@ subst (x, from, to, in_dest, unique_copy) return temp; } + /* If we want a subreg of a constant, at offset 0, + take the low bits. On a little-endian machine, that's + always valid. On a big-endian machine, it's valid + only if the constant's mode fits in one word. */ if (CONSTANT_P (SUBREG_REG (x)) && subreg_lowpart_p (x) - && GET_MODE_SIZE (mode) < GET_MODE_SIZE (op0_mode)) + && GET_MODE_SIZE (mode) < GET_MODE_SIZE (op0_mode) +#if WORDS_BIG_ENDIAN + && GET_MODE_BITSIZE (op0_mode) < BITS_PER_WORD +#endif + ) return gen_lowpart_for_combine (mode, SUBREG_REG (x)); /* If we are narrowing the object, we need to see if we can simplify |