summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-05 09:05:58 +0000
committerlaw <law@138bc75d-0d04-0410-961f-82ee72b054a4>1998-10-05 09:05:58 +0000
commitfc84b6f26828d89c4c34d17d5cc6a813aca0a972 (patch)
tree9ece943458af2f7b8f7e40902dc98b737f1316d0 /gcc/combine.c
parent12914686d56ac93a91d67c3c23f8e96e853777a2 (diff)
downloadgcc-fc84b6f26828d89c4c34d17d5cc6a813aca0a972.tar.gz
8
* combine.c (simplify_rtx): Do not replace TRUNCATE with a SUBREG if truncation is not a no-op. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@22835 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index ce488e294c4..420a60fca5f 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