diff options
author | Jeff Law <law@gcc.gnu.org> | 1998-10-05 03:05:58 -0600 |
---|---|---|
committer | Jeff Law <law@gcc.gnu.org> | 1998-10-05 03:05:58 -0600 |
commit | 6a99221410423745185084b26eeb5fd79860a4aa (patch) | |
tree | 9ece943458af2f7b8f7e40902dc98b737f1316d0 /gcc | |
parent | f385990fce4b9af5c3efd16157557fb23a340df3 (diff) | |
download | gcc-6a99221410423745185084b26eeb5fd79860a4aa.zip gcc-6a99221410423745185084b26eeb5fd79860a4aa.tar.gz gcc-6a99221410423745185084b26eeb5fd79860a4aa.tar.bz2 |
combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if truncation is not a no-op.
8
* combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if
truncation is not a no-op.
From-SVN: r22835
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/combine.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c index ce488e2..420a60f 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -3773,9 +3773,12 @@ simplify_rtx (x, op0_mode, last, in_dest) return SUBREG_REG (XEXP (x, 0)); /* If we know that the value is already truncated, we can - replace the TRUNCATE with a SUBREG. */ - if (num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0))) - >= GET_MODE_BITSIZE (mode) + 1) + replace the TRUNCATE with a SUBREG if TRULY_NOOP_TRUNCATION is + nonzero for the corresponding modes. */ + if (TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode), + GET_MODE_BITSIZE (GET_MODE (XEXP (x, 0)))) + && num_sign_bit_copies (XEXP (x, 0), GET_MODE (XEXP (x, 0))) + >= GET_MODE_BITSIZE (mode) + 1) return gen_lowpart_for_combine (mode, XEXP (x, 0)); /* A truncate of a comparison can be replaced with a subreg if |