]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c-common.c (convert_vector_to_pointer_for_subscript): Remove cast to unsigned type.
authorRichard Sandiford <rdsandiford@googlemail.com>
Mon, 18 Nov 2013 14:52:56 +0000 (14:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Mon, 18 Nov 2013 14:52:56 +0000 (14:52 +0000)
gcc/c-family/
* c-common.c (convert_vector_to_pointer_for_subscript): Remove
cast to unsigned type.

gcc/
* tree.h (tree_to_uhwi): Return an unsigned HOST_WIDE_INT.
* tree.c (tree_to_uhwi): Return an unsigned HOST_WIDE_INT.
(tree_ctz): Remove cast to unsigned type.
* builtins.c (fold_builtin_memory_op): Likewise.
* dwarf2out.c (descr_info_loc): Likewise.
* godump.c (go_output_typedef): Likewise.
* omp-low.c (expand_omp_simd): Likewise.
* stor-layout.c (excess_unit_span): Likewise.
* tree-object-size.c (addr_object_size): Likewise.
* tree-sra.c (analyze_all_variable_accesses): Likewise.
* tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
(simplify_rotate): Likewise.
* tree-ssa-strlen.c (adjust_last_stmt, handle_builtin_memcpy)
(handle_pointer_plus): Likewise.
* tree-switch-conversion.c (check_range): Likewise.
* tree-vect-patterns.c (vect_recog_rotate_pattern): Likewise.
* tsan.c (instrument_builtin_call): Likewise.
* cfgexpand.c (defer_stack_allocation): Add cast to HOST_WIDE_INT.
* trans-mem.c (tm_log_add): Likewise.
* config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Likewise.
* config/arm/arm.c (aapcs_vfp_sub_candidate): Likewise.
* config/rs6000/rs6000.c (rs6000_aggregate_candidate): Likewise.
* config/mips/mips.c (r10k_safe_mem_expr_p): Make offset unsigned.

From-SVN: r204964

23 files changed:
gcc/ChangeLog
gcc/builtins.c
gcc/c-family/ChangeLog
gcc/c-family/c-common.c
gcc/cfgexpand.c
gcc/config/aarch64/aarch64.c
gcc/config/arm/arm.c
gcc/config/mips/mips.c
gcc/config/rs6000/rs6000.c
gcc/dwarf2out.c
gcc/godump.c
gcc/omp-low.c
gcc/stor-layout.c
gcc/trans-mem.c
gcc/tree-object-size.c
gcc/tree-sra.c
gcc/tree-ssa-forwprop.c
gcc/tree-ssa-strlen.c
gcc/tree-switch-conversion.c
gcc/tree-vect-patterns.c
gcc/tree.c
gcc/tree.h
gcc/tsan.c

index 6768fec5b193e24f383be725f0a0fbe3c1788420..7220961ba607c459a991eeea1aaffac8d7c2be55 100644 (file)
@@ -1,3 +1,29 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * tree.h (tree_to_uhwi): Return an unsigned HOST_WIDE_INT.
+       * tree.c (tree_to_uhwi): Return an unsigned HOST_WIDE_INT.
+       (tree_ctz): Remove cast to unsigned type.
+       * builtins.c (fold_builtin_memory_op): Likewise.
+       * dwarf2out.c (descr_info_loc): Likewise.
+       * godump.c (go_output_typedef): Likewise.
+       * omp-low.c (expand_omp_simd): Likewise.
+       * stor-layout.c (excess_unit_span): Likewise.
+       * tree-object-size.c (addr_object_size): Likewise.
+       * tree-sra.c (analyze_all_variable_accesses): Likewise.
+       * tree-ssa-forwprop.c (simplify_builtin_call): Likewise.
+       (simplify_rotate): Likewise.
+       * tree-ssa-strlen.c (adjust_last_stmt, handle_builtin_memcpy)
+       (handle_pointer_plus): Likewise.
+       * tree-switch-conversion.c (check_range): Likewise.
+       * tree-vect-patterns.c (vect_recog_rotate_pattern): Likewise.
+       * tsan.c (instrument_builtin_call): Likewise.
+       * cfgexpand.c (defer_stack_allocation): Add cast to HOST_WIDE_INT.
+       * trans-mem.c (tm_log_add): Likewise.
+       * config/aarch64/aarch64.c (aapcs_vfp_sub_candidate): Likewise.
+       * config/arm/arm.c (aapcs_vfp_sub_candidate): Likewise.
+       * config/rs6000/rs6000.c (rs6000_aggregate_candidate): Likewise.
+       * config/mips/mips.c (r10k_safe_mem_expr_p): Make offset unsigned.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * tree.h (host_integerp, tree_low_cst): Delete.
index 1405868ec39508d6811af887d581aad999d2e9f6..39d40cb75e7bcd890110dab4690b03de9d5dff2f 100644 (file)
@@ -8781,7 +8781,7 @@ fold_builtin_memory_op (location_t loc, tree dest, tree src,
          if (readonly_data_expr (src)
              || (tree_fits_uhwi_p (len)
                  && (MIN (src_align, dest_align) / BITS_PER_UNIT
-                     >= (unsigned HOST_WIDE_INT) tree_to_uhwi (len))))
+                     >= tree_to_uhwi (len))))
            {
              tree fn = builtin_decl_implicit (BUILT_IN_MEMCPY);
              if (!fn)
index 8aac23c700a718ed93d256242cafdbd79467da39..113b4edda79f882bdf6c4e42410a6bb1b052234c 100644 (file)
@@ -1,3 +1,8 @@
+2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * c-common.c (convert_vector_to_pointer_for_subscript): Remove
+       cast to unsigned type.
+
 2013-11-18  Richard Sandiford  <rdsandiford@googlemail.com>
 
        * c-common.c (fold_offsetof_1): Use tree_to_uhwi rather than
index fb8295dfdc539ede331adc4bc0c0f2544bfe717e..83d6253cbfd497fea4649a209b376402259f036a 100644 (file)
@@ -11702,8 +11702,7 @@ convert_vector_to_pointer_for_subscript (location_t loc,
 
       if (TREE_CODE (index) == INTEGER_CST)
         if (!tree_fits_uhwi_p (index)
-            || ((unsigned HOST_WIDE_INT) tree_to_uhwi (index)
-               >= TYPE_VECTOR_SUBPARTS (type)))
+            || tree_to_uhwi (index) >= TYPE_VECTOR_SUBPARTS (type))
           warning_at (loc, OPT_Warray_bounds, "index value is out of bound");
 
       c_common_mark_addressable_vec (*vecp);
index 7732b097ea785f1cd14b020bc3ec453eae3c40f6..85732c8f0d7596966c284165dc5b2d1ed07b5f56 100644 (file)
@@ -1133,7 +1133,7 @@ defer_stack_allocation (tree var, bool toplevel)
   /* Whether the variable is small enough for immediate allocation not to be
      a problem with regard to the frame size.  */
   bool smallish
-    = (tree_to_uhwi (DECL_SIZE_UNIT (var))
+    = ((HOST_WIDE_INT) tree_to_uhwi (DECL_SIZE_UNIT (var))
        < PARAM_VALUE (PARAM_MIN_SIZE_FOR_STACK_SHARING));
 
   /* If stack protection is enabled, *all* stack variables must be deferred,
index 3bc35935248f5fbffdc4f22461db083ad2b1f00a..edd378ce69d8df32d3b10356d8679b5080bea6e5 100644 (file)
@@ -6041,7 +6041,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
@@ -6071,7 +6071,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
@@ -6103,7 +6103,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
index 72ba2ed5548b4d7362756002a08a97b2931b6135..3ee27b4b7be1ad9aba36804d7510a32daa481107 100644 (file)
@@ -4739,7 +4739,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
@@ -4769,7 +4769,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
@@ -4801,7 +4801,7 @@ aapcs_vfp_sub_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
index c2666317caa2b80601670482cf037fd5eab46b3e..80bbb00c2c8465c5bc0cd11a0812ebbda0168765 100644 (file)
@@ -14927,7 +14927,7 @@ r10k_safe_address_p (rtx x, rtx insn)
    a link-time-constant address.  */
 
 static bool
-r10k_safe_mem_expr_p (tree expr, HOST_WIDE_INT offset)
+r10k_safe_mem_expr_p (tree expr, unsigned HOST_WIDE_INT offset)
 {
   HOST_WIDE_INT bitoffset, bitsize;
   tree inner, var_offset;
@@ -14940,7 +14940,7 @@ r10k_safe_mem_expr_p (tree expr, HOST_WIDE_INT offset)
     return false;
 
   offset += bitoffset / BITS_PER_UNIT;
-  return offset >= 0 && offset < tree_to_uhwi (DECL_SIZE_UNIT (inner));
+  return offset < tree_to_uhwi (DECL_SIZE_UNIT (inner));
 }
 
 /* A for_each_rtx callback for which DATA points to the instruction
index cb6ce999a300978b10b2e1aa00520cc57508c29c..bfa061c8c6e4029a25a56ed2c2fb5f3510a33860 100644 (file)
@@ -8564,7 +8564,7 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
@@ -8594,7 +8594,7 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
@@ -8626,7 +8626,7 @@ rs6000_aggregate_candidate (const_tree type, enum machine_mode *modep)
 
        /* There must be no padding.  */
        if (!tree_fits_uhwi_p (TYPE_SIZE (type))
-           || (tree_to_uhwi (TYPE_SIZE (type))
+           || ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
                != count * GET_MODE_BITSIZE (*modep)))
          return -1;
 
index 4f7bcf4f79e2d2387559a0cd45de3ebbda02e840..0095507ee1a6442b7502d38e9ccbc9bdc4afc80d 100644 (file)
@@ -17073,8 +17073,7 @@ descr_info_loc (tree val, tree base_decl)
     case POINTER_PLUS_EXPR:
     case PLUS_EXPR:
       if (tree_fits_uhwi_p (TREE_OPERAND (val, 1))
-         && (unsigned HOST_WIDE_INT) tree_to_uhwi (TREE_OPERAND (val, 1))
-            < 16384)
+         && tree_to_uhwi (TREE_OPERAND (val, 1)) < 16384)
        {
          loc = descr_info_loc (TREE_OPERAND (val, 0), base_decl);
          if (!loc)
index 4c319c47737d53f67764de0abe50d3b04927c7fe..3efbc7c988b100eb185b38f0adfe39650cf4eaa4 100644 (file)
@@ -986,8 +986,7 @@ go_output_typedef (struct godump_container *container, tree decl)
                     tree_to_shwi (TREE_VALUE (element)));
          else if (tree_fits_uhwi_p (TREE_VALUE (element)))
            snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_UNSIGNED,
-                    ((unsigned HOST_WIDE_INT)
-                     tree_to_uhwi (TREE_VALUE (element))));
+                     tree_to_uhwi (TREE_VALUE (element)));
          else
            snprintf (buf, sizeof buf, HOST_WIDE_INT_PRINT_DOUBLE_HEX,
                     ((unsigned HOST_WIDE_INT)
index 4141dd9a6c0d46d4b23ff33ae648c4ee40f21d95..f850f53e441957d2cff45864ef31a203500584d0 100644 (file)
@@ -6770,8 +6770,7 @@ expand_omp_simd (struct omp_region *region, struct omp_for_data *fd)
        {
          safelen = OMP_CLAUSE_SAFELEN_EXPR (safelen);
          if (!tree_fits_uhwi_p (safelen)
-             || (unsigned HOST_WIDE_INT) tree_to_uhwi (safelen)
-                > INT_MAX)
+             || tree_to_uhwi (safelen) > INT_MAX)
            loop->safelen = INT_MAX;
          else
            loop->safelen = tree_to_uhwi (safelen);
index 659bfbb55663bb3b0926d58e8643b7a2020dd795..535b897f80c02c8fcb8871ce8157546b1032833e 100644 (file)
@@ -1053,8 +1053,7 @@ excess_unit_span (HOST_WIDE_INT byte_offset, HOST_WIDE_INT bit_offset,
 
   offset = offset % align;
   return ((offset + size + align - 1) / align
-         > ((unsigned HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE (type))
-            / align));
+         > tree_to_uhwi (TYPE_SIZE (type)) / align);
 }
 #endif
 
index d3cc1ab5e8124e322094c6bbc42a264f41eb6029..879f37b9177cc04f88dad950e5038c5e678cff21 100644 (file)
@@ -1104,7 +1104,7 @@ tm_log_add (basic_block entry_block, tree addr, gimple stmt)
          && transaction_invariant_address_p (lp->addr, entry_block)
          && TYPE_SIZE_UNIT (type) != NULL
          && tree_fits_uhwi_p (TYPE_SIZE_UNIT (type))
-         && (tree_to_uhwi (TYPE_SIZE_UNIT (type))
+         && ((HOST_WIDE_INT) tree_to_uhwi (TYPE_SIZE_UNIT (type))
              < PARAM_VALUE (PARAM_TM_MAX_AGGREGATE_SIZE))
          /* We must be able to copy this type normally.  I.e., no
             special constructors and the like.  */
index f3fb932de231b4050a6619684a626f7507739061..51a5d590a2cb28455392df43c52a2456a2a68222 100644 (file)
@@ -210,15 +210,13 @@ addr_object_size (struct object_size_info *osi, const_tree ptr,
   else if (pt_var
           && DECL_P (pt_var)
           && tree_fits_uhwi_p (DECL_SIZE_UNIT (pt_var))
-          && (unsigned HOST_WIDE_INT)
-               tree_to_uhwi (DECL_SIZE_UNIT (pt_var)) < offset_limit)
+          && tree_to_uhwi (DECL_SIZE_UNIT (pt_var)) < offset_limit)
     pt_var_size = DECL_SIZE_UNIT (pt_var);
   else if (pt_var
           && TREE_CODE (pt_var) == STRING_CST
           && TYPE_SIZE_UNIT (TREE_TYPE (pt_var))
           && tree_fits_uhwi_p (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)))
-          && (unsigned HOST_WIDE_INT)
-             tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)))
+          && tree_to_uhwi (TYPE_SIZE_UNIT (TREE_TYPE (pt_var)))
              < offset_limit)
     pt_var_size = TYPE_SIZE_UNIT (TREE_TYPE (pt_var));
   else
index 1194d099650864597dae0bed01ee5f81a8c5233c..b4b17882d2a9e602cd8b80a61ee1e7caccc04831 100644 (file)
@@ -2488,7 +2488,7 @@ analyze_all_variable_accesses (void)
        if (TREE_CODE (var) == VAR_DECL
            && type_consists_of_records_p (TREE_TYPE (var)))
          {
-           if ((unsigned) tree_to_uhwi (TYPE_SIZE (TREE_TYPE (var)))
+           if (tree_to_uhwi (TYPE_SIZE (TREE_TYPE (var)))
                <= max_total_scalarization_size)
              {
                completely_scalarize_var (var);
index 0a8d42561c46bd3246e9fa83d89b97e590606545..817fa9f461451ef2adef7d47618287a550d22c8b 100644 (file)
@@ -1601,7 +1601,7 @@ simplify_builtin_call (gimple_stmt_iterator *gsi_p, tree callee2)
             as the new memcpy length, if it is too big, bail out.  */
          src_len = tree_to_uhwi (diff);
          src_len += tree_to_uhwi (len2);
-         if (src_len < (unsigned HOST_WIDE_INT) tree_to_uhwi (len1))
+         if (src_len < tree_to_uhwi (len1))
            src_len = tree_to_uhwi (len1);
          if (src_len > 1024)
            break;
@@ -2319,7 +2319,7 @@ simplify_rotate (gimple_stmt_iterator *gsi)
   /* CNT1 + CNT2 == B case above.  */
   if (tree_fits_uhwi_p (def_arg2[0])
       && tree_fits_uhwi_p (def_arg2[1])
-      && (unsigned HOST_WIDE_INT) tree_to_uhwi (def_arg2[0])
+      && tree_to_uhwi (def_arg2[0])
         + tree_to_uhwi (def_arg2[1]) == TYPE_PRECISION (rtype))
     rotcnt = def_arg2[0];
   else if (TREE_CODE (def_arg2[0]) != SSA_NAME
index bf2a5fb61d583be8ed1ef95b52bbc3fadb74f483..04e9ef4a0e2b0fbe8b34da3da681a9a2ff3b0ce3 100644 (file)
@@ -850,12 +850,11 @@ adjust_last_stmt (strinfo si, gimple stmt, bool is_strcat)
     {
       if (!tree_fits_uhwi_p (last.len)
          || integer_zerop (len)
-         || (unsigned HOST_WIDE_INT) tree_to_uhwi (len)
-            != (unsigned HOST_WIDE_INT) tree_to_uhwi (last.len) + 1)
+         || tree_to_uhwi (len) != tree_to_uhwi (last.len) + 1)
        return;
       /* Don't adjust the length if it is divisible by 4, it is more efficient
         to store the extra '\0' in that case.  */
-      if ((((unsigned HOST_WIDE_INT) tree_to_uhwi (len)) & 3) == 0)
+      if ((tree_to_uhwi (len) & 3) == 0)
        return;
     }
   else if (TREE_CODE (len) == SSA_NAME)
@@ -1337,8 +1336,7 @@ handle_builtin_memcpy (enum built_in_function bcode, gimple_stmt_iterator *gsi)
       /* Handle memcpy (x, "abcd", 5) or
         memcpy (x, "abc\0uvw", 7).  */
       if (!tree_fits_uhwi_p (len)
-         || (unsigned HOST_WIDE_INT) tree_to_uhwi (len)
-            <= (unsigned HOST_WIDE_INT) ~idx)
+         || tree_to_uhwi (len) <= (unsigned HOST_WIDE_INT) ~idx)
        return;
     }
 
@@ -1627,8 +1625,7 @@ handle_pointer_plus (gimple_stmt_iterator *gsi)
     {
       tree off = gimple_assign_rhs2 (stmt);
       if (tree_fits_uhwi_p (off)
-         && (unsigned HOST_WIDE_INT) tree_to_uhwi (off)
-            <= (unsigned HOST_WIDE_INT) ~idx)
+         && tree_to_uhwi (off) <= (unsigned HOST_WIDE_INT) ~idx)
        ssa_ver_to_stridx[SSA_NAME_VERSION (lhs)]
            = ~(~idx - (int) tree_to_uhwi (off));
       return;
index a4340a49a8b7f1eeb98b720db27f0017f9dbc2e0..fa31e22d525d43df2b1cf834169d4a01e8abf226 100644 (file)
@@ -701,7 +701,7 @@ check_range (struct switch_conv_info *info)
       return false;
     }
 
-  if ((unsigned HOST_WIDE_INT) tree_to_uhwi (info->range_size)
+  if (tree_to_uhwi (info->range_size)
       > ((unsigned) info->count * SWITCH_CONVERSION_BRANCH_RATIO))
     {
       info->reason = "the maximum range-branch ratio exceeded";
index c186c9a5a96ffbc2036ac304c1dc819ac836f513..0992fbc9c7358882ebc00086b47fb1637cbe71be 100644 (file)
@@ -1636,8 +1636,7 @@ vect_recog_rotate_pattern (vec<gimple> *stmts, tree *type_in, tree *type_out)
   if (TREE_CODE (def) == INTEGER_CST)
     {
       if (!tree_fits_uhwi_p (def)
-         || (unsigned HOST_WIDE_INT) tree_to_uhwi (def)
-            >= GET_MODE_PRECISION (TYPE_MODE (type))
+         || tree_to_uhwi (def) >= GET_MODE_PRECISION (TYPE_MODE (type))
          || integer_zerop (def))
        return NULL;
       def2 = build_int_cst (stype,
index 836db518b4510a8bfab0b28e8e9cdde766b9a823..5e098b5e32e07fcd9cefb12c09330e578e3c5f37 100644 (file)
@@ -2211,8 +2211,7 @@ tree_ctz (const_tree expr)
     case LSHIFT_EXPR:
       ret1 = tree_ctz (TREE_OPERAND (expr, 0));
       if (tree_fits_uhwi_p (TREE_OPERAND (expr, 1))
-         && ((unsigned HOST_WIDE_INT) tree_to_uhwi (TREE_OPERAND (expr, 1))
-             < (unsigned HOST_WIDE_INT) prec))
+         && (tree_to_uhwi (TREE_OPERAND (expr, 1)) < prec))
        {
          ret2 = tree_to_uhwi (TREE_OPERAND (expr, 1));
          return MIN (ret1 + ret2, prec);
@@ -2220,8 +2219,7 @@ tree_ctz (const_tree expr)
       return ret1;
     case RSHIFT_EXPR:
       if (tree_fits_uhwi_p (TREE_OPERAND (expr, 1))
-         && ((unsigned HOST_WIDE_INT) tree_to_uhwi (TREE_OPERAND (expr, 1))
-             < (unsigned HOST_WIDE_INT) prec))
+         && (tree_to_uhwi (TREE_OPERAND (expr, 1)) < prec))
        {
          ret1 = tree_ctz (TREE_OPERAND (expr, 0));
          ret2 = tree_to_uhwi (TREE_OPERAND (expr, 1));
@@ -7011,7 +7009,7 @@ tree_to_shwi (const_tree t)
    TYPE_UNSIGNED) fits in an unsigned HOST_WIDE_INT.  Return that
    HOST_WIDE_INT.  */
 
-HOST_WIDE_INT
+unsigned HOST_WIDE_INT
 tree_to_uhwi (const_tree t)
 {
   gcc_assert (tree_fits_uhwi_p (t));
index 2ac3480fc6a47ded92c68f6a08a6947b78c6b2be..f63672c0897c9a8cf81c1dad509fadd2a6fd522b 100644 (file)
@@ -3668,7 +3668,7 @@ extern bool tree_fits_uhwi_p (const_tree)
 #endif
   ;
 extern HOST_WIDE_INT tree_to_shwi (const_tree);
-extern HOST_WIDE_INT tree_to_uhwi (const_tree);
+extern unsigned HOST_WIDE_INT tree_to_uhwi (const_tree);
 #if !defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 4003)
 extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT
 tree_to_shwi (const_tree t)
@@ -3677,7 +3677,7 @@ tree_to_shwi (const_tree t)
   return TREE_INT_CST_LOW (t);
 }
 
-extern inline __attribute__ ((__gnu_inline__)) HOST_WIDE_INT
+extern inline __attribute__ ((__gnu_inline__)) unsigned HOST_WIDE_INT
 tree_to_uhwi (const_tree t)
 {
   gcc_assert (tree_fits_uhwi_p (t));
index 8aac468a4445be00db3c2246df38923881f8acdb..b8f65af65411a0da92b88e198cf8de57a4e8c5ca 100644 (file)
@@ -448,8 +448,7 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
          case fetch_op:
            last_arg = gimple_call_arg (stmt, num - 1);
            if (!tree_fits_uhwi_p (last_arg)
-               || (unsigned HOST_WIDE_INT) tree_to_uhwi (last_arg)
-                  > MEMMODEL_SEQ_CST)
+               || tree_to_uhwi (last_arg) > MEMMODEL_SEQ_CST)
              return;
            gimple_call_set_fndecl (stmt, decl);
            update_stmt (stmt);
@@ -520,12 +519,10 @@ instrument_builtin_call (gimple_stmt_iterator *gsi)
            for (j = 0; j < 6; j++)
              args[j] = gimple_call_arg (stmt, j);
            if (!tree_fits_uhwi_p (args[4])
-               || (unsigned HOST_WIDE_INT) tree_to_uhwi (args[4])
-                  > MEMMODEL_SEQ_CST)
+               || tree_to_uhwi (args[4]) > MEMMODEL_SEQ_CST)
              return;
            if (!tree_fits_uhwi_p (args[5])
-               || (unsigned HOST_WIDE_INT) tree_to_uhwi (args[5])
-                  > MEMMODEL_SEQ_CST)
+               || tree_to_uhwi (args[5]) > MEMMODEL_SEQ_CST)
              return;
            update_gimple_call (gsi, decl, 5, args[0], args[1], args[2],
                                args[4], args[5]);