summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-03 18:12:15 +0000
committernemet <nemet@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-03 18:12:15 +0000
commit0f6d8eebedb8889622ac22e951cda9a462379be8 (patch)
tree021ce578c76b004900ccfc68b913f823be3d27d9
parentd76551d98c1ded3ab59400d7dff1dc1d8ebab1f1 (diff)
downloadgcc-0f6d8eebedb8889622ac22e951cda9a462379be8.tar.gz
* simplify-rtx.c (simplify_unary_operation_1) <TRUNCATE>: When
trying to remove TRUNCATE check if all bits outside the new mode are identical to the sign bit. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@112643 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/simplify-rtx.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b264035e7c7..d15763234be 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2006-04-03 Adam Nemet <anemet@caviumnetworks.com>
+
+ * simplify-rtx.c (simplify_unary_operation_1) <TRUNCATE>: When
+ trying to remove TRUNCATE check if all bits outside the new mode
+ are identical to the sign bit.
+
2006-04-03 Jeff Law <law@redhat.com>
* tree-ssa-dom.c (propagate_rhs_into_lhs): Avoid useless folding
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index cac77ad1fce..0ce033df208 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -656,7 +656,8 @@ simplify_unary_operation_1 (enum rtx_code code, enum machine_mode mode, rtx op)
if ((TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
GET_MODE_BITSIZE (GET_MODE (op)))
? (num_sign_bit_copies (op, GET_MODE (op))
- >= (unsigned int) (GET_MODE_BITSIZE (mode) + 1))
+ > (unsigned int) (GET_MODE_BITSIZE (GET_MODE (op))
+ - GET_MODE_BITSIZE (mode)))
: truncated_to_mode (mode, op))
&& ! (GET_CODE (op) == LSHIFTRT
&& GET_CODE (XEXP (op, 0)) == MULT))