]> gcc.gnu.org Git - gcc.git/commitdiff
simplify-rtx.c (simplify_unary_operation_1): When trying to remove TRUNCATE check...
authorAdam Nemet <anemet@caviumnetworks.com>
Mon, 3 Apr 2006 18:12:15 +0000 (18:12 +0000)
committerAdam Nemet <nemet@gcc.gnu.org>
Mon, 3 Apr 2006 18:12:15 +0000 (18:12 +0000)
* 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.

From-SVN: r112643

gcc/ChangeLog
gcc/simplify-rtx.c

index b264035e7c7a9344dd0d8f8a1e1ac82e13076f1b..d15763234bee557810d518e2b0f931bf95245d8d 100644 (file)
@@ -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
index cac77ad1fce046d3fce0eceaa98b3710bad141c1..0ce033df208a9ba71e3169c87ad74f4af94b8049 100644 (file)
@@ -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))
This page took 0.080341 seconds and 5 git commands to generate.