From de7f492b6140cbaed6a3ca5b7ad478df15d7df30 Mon Sep 17 00:00:00 2001 From: Adam Nemet Date: Tue, 14 Feb 2006 17:45:55 +0000 Subject: [PATCH] * simplify-rtx.c (simplify_subreg): Combine SUBREG and TRUNCATE. From-SVN: r110990 --- gcc/ChangeLog | 4 ++++ gcc/simplify-rtx.c | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 935add304c1..17c8b5f7a51 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2006-02-14 Adam Nemet + + * simplify-rtx.c (simplify_subreg): Combine SUBREG and TRUNCATE. + 2006-02-14 Rainer Orth PR bootstrap/26053 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, -- 2.30.2