summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authornemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 17:45:55 +0000
committernemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 17:45:55 +0000
commit2ec9725b3a85d7f566c0f8e257c53c5edd2d8989 (patch)
tree0f30a432f7d2bcab1915731bfcfe037cbff9249a /gcc/simplify-rtx.c
parentf3424fe63fb30896267cd3d2ee562399740112b2 (diff)
downloadgcc-2ec9725b3a85d7f566c0f8e257c53c5edd2d8989.tar.gz
* simplify-rtx.c (simplify_subreg): Combine SUBREG and TRUNCATE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110990 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index c949dea1d16..6f4f09b8e09 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -4426,6 +4426,14 @@ simplify_subreg (enum machine_mode outermode, rtx op,
return NULL_RTX;
}
+ /* Merge implicit and explicit truncations. */
+
+ if (GET_CODE (op) == TRUNCATE
+ && GET_MODE_SIZE (outermode) < GET_MODE_SIZE (innermode)
+ && subreg_lowpart_offset (outermode, innermode) == byte)
+ return simplify_gen_unary (TRUNCATE, outermode, XEXP (op, 0),
+ GET_MODE (XEXP (op, 0)));
+
/* SUBREG of a hard register => just change the register number
and/or mode. If the hard register is not valid in that mode,
suppress this simplification. If the hard register is the stack,