aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAdam Nemet <anemet@caviumnetworks.com>2006-02-14 07:10:35 +0000
committerAdam Nemet <nemet@gcc.gnu.org>2006-02-14 07:10:35 +0000
commite963b866133cdc6d1244d61647f4f236715f6a77 (patch)
treebc2ef4c9ed0be960f611c4b02d11af7828b26e2e /gcc
parent3bf78d3be26e89446da009f5c5e562d8ba1a1179 (diff)
downloadgcc-e963b866133cdc6d1244d61647f4f236715f6a77.zip
gcc-e963b866133cdc6d1244d61647f4f236715f6a77.tar.gz
gcc-e963b866133cdc6d1244d61647f4f236715f6a77.tar.bz2
simplify-rtx.c (simplify_unary_operation_1): Return new expression in the requested machine mode.
* simplify-rtx.c (simplify_unary_operation_1) <TRUNCATE>: Return new expression in the requested machine mode. From-SVN: r110959
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/simplify-rtx.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6ffd332..ca77775 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2006-02-13 Adam Nemet <anemet@caviumnetworks.com>
+
+ * simplify-rtx.c (simplify_unary_operation_1) <TRUNCATE>: Return
+ new expression in the requested machine mode.
+
2006-02-13 Roger Sayle <roger@eyesopen.com>
* optabs.c (expand_abs): Don't call do_jump_by_parts_greater_rtx
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 4cdbad7..c949dea 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