aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2006-02-14 17:45:55 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2006-02-14 17:45:55 +0000
commitde7f492b6140cbaed6a3ca5b7ad478df15d7df30 (patch)
tree0f30a432f7d2bcab1915731bfcfe037cbff9249a /gcc
parent1cf0118daf84744dfc457bdb30c0c3816ae07307 (diff)
downloadgcc-de7f492b6140cbaed6a3ca5b7ad478df15d7df30.zip
gcc-de7f492b6140cbaed6a3ca5b7ad478df15d7df30.tar.gz
gcc-de7f492b6140cbaed6a3ca5b7ad478df15d7df30.tar.bz2
* simplify-rtx.c (simplify_subreg): Combine SUBREG and TRUNCATE.
From-SVN: r110990
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/simplify-rtx.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 935add3..17c8b5f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2006-02-14 Adam Nemet <anemet@caviumnetworks.com>
+
+ * simplify-rtx.c (simplify_subreg): Combine SUBREG and TRUNCATE.
+
2006-02-14 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
PR bootstrap/26053
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index c949dea..6f4f09b 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,