summaryrefslogtreecommitdiff
path: root/gcc/simplify-rtx.c
diff options
context:
space:
mode:
authornemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 07:10:35 +0000
committernemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-14 07:10:35 +0000
commitc2e0ce216797712a6ce774670ff6753428d2f16a (patch)
treebc2ef4c9ed0be960f611c4b02d11af7828b26e2e /gcc/simplify-rtx.c
parentc071a2dff4d3e938f05021e7568bfae44bde944c (diff)
downloadgcc-c2e0ce216797712a6ce774670ff6753428d2f16a.tar.gz
* simplify-rtx.c (simplify_unary_operation_1) <TRUNCATE>: Return
new expression in the requested machine mode. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110959 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r--gcc/simplify-rtx.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 4cdbad754ed..c949dea1d16 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -609,12 +609,13 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
return simplify_gen_unary (GET_CODE (op), mode,
XEXP (XEXP (op, 0), 0), mode);
- /* (truncate:SI (subreg:DI (truncate:SI X) 0)) is
- (truncate:SI x). */
+ /* (truncate:A (subreg:B (truncate:C X) 0)) is
+ (truncate:A X). */
if (GET_CODE (op) == SUBREG
&& GET_CODE (SUBREG_REG (op)) == TRUNCATE
&& subreg_lowpart_p (op))
- return SUBREG_REG (op);
+ return simplify_gen_unary (TRUNCATE, mode, XEXP (SUBREG_REG (op), 0),
+ GET_MODE (XEXP (SUBREG_REG (op), 0)));
/* If we know that the value is already truncated, we can
replace the TRUNCATE with a SUBREG if TRULY_NOOP_TRUNCATION