]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
dwarf2out.c (gen_enumeration_type_die): Remove unnecessary host_integerp test.
authorRichard Sandiford <rdsandiford@googlemail.com>
Fri, 15 Nov 2013 14:52:23 +0000 (14:52 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Fri, 15 Nov 2013 14:52:23 +0000 (14:52 +0000)
gcc/
* dwarf2out.c (gen_enumeration_type_die): Remove unnecessary
host_integerp test.
* tree-vect-patterns.c (vect_recog_divmod_pattern): Likewise.
Use TREE_INT_CST_LOW rather than tree_low_cst when reading the
constant.
* fold-const.c (fold_binary_loc): Replace a host_integerp/tree_low_cst
pair with a TREE_CODE test and TREE_INT_CST_LOW.
* tree-vect-generic.c (expand_vector_divmod): Likewise.

From-SVN: r204846

gcc/ChangeLog
gcc/dwarf2out.c
gcc/fold-const.c
gcc/tree-vect-generic.c
gcc/tree-vect-patterns.c

index 697a5c61dc04a71a00009fbdcca6bfc06d62a132..e5d586c10fcb65bfa24915f61f7b4c743788b515 100644 (file)
@@ -1,3 +1,14 @@
+2013-11-15  Richard Sandiford  <rdsandiford@googlemail.com>
+
+       * dwarf2out.c (gen_enumeration_type_die): Remove unnecessary
+       host_integerp test.
+       * tree-vect-patterns.c (vect_recog_divmod_pattern): Likewise.
+       Use TREE_INT_CST_LOW rather than tree_low_cst when reading the
+       constant.
+       * fold-const.c (fold_binary_loc): Replace a host_integerp/tree_low_cst
+       pair with a TREE_CODE test and TREE_INT_CST_LOW.
+       * tree-vect-generic.c (expand_vector_divmod): Likewise.
+
 2013-11-15  Richard Biener  <rguenther@suse.de>
 
        PR tree-optimization/50262
index 3822a652d80c0ad0e6c3f5d96172c7f31e093eee..24f405ec26ab20080793faa918f715f777960c97 100644 (file)
@@ -17321,9 +17321,8 @@ gen_enumeration_type_die (tree type, dw_die_ref context_die)
          if (TREE_CODE (value) == CONST_DECL)
            value = DECL_INITIAL (value);
 
-         if (host_integerp (value, TYPE_UNSIGNED (TREE_TYPE (value)))
-             && (simple_type_size_in_bits (TREE_TYPE (value))
-                 <= HOST_BITS_PER_WIDE_INT || host_integerp (value, 0)))
+         if (simple_type_size_in_bits (TREE_TYPE (value))
+             <= HOST_BITS_PER_WIDE_INT || host_integerp (value, 0))
            /* DWARF2 does not provide a way of indicating whether or
               not enumeration constants are signed or unsigned.  GDB
               always assumes the values are signed, so we output all
index d08d0cdd069cfaba7cada3b0ff8d93c2be937238..87cde0454a343fa0e442609e1b209c5d62622c56 100644 (file)
@@ -12033,16 +12033,15 @@ fold_binary_loc (location_t loc,
         if the new mask might be further optimized.  */
       if ((TREE_CODE (arg0) == LSHIFT_EXPR
           || TREE_CODE (arg0) == RSHIFT_EXPR)
-         && host_integerp (TREE_OPERAND (arg0, 1), 1)
-         && host_integerp (arg1, TYPE_UNSIGNED (TREE_TYPE (arg1)))
-         && tree_low_cst (TREE_OPERAND (arg0, 1), 1)
-            < TYPE_PRECISION (TREE_TYPE (arg0))
          && TYPE_PRECISION (TREE_TYPE (arg0)) <= HOST_BITS_PER_WIDE_INT
-         && tree_low_cst (TREE_OPERAND (arg0, 1), 1) > 0)
+         && TREE_CODE (arg1) == INTEGER_CST
+         && host_integerp (TREE_OPERAND (arg0, 1), 1)
+         && tree_low_cst (TREE_OPERAND (arg0, 1), 1) > 0
+         && (tree_low_cst (TREE_OPERAND (arg0, 1), 1)
+             < TYPE_PRECISION (TREE_TYPE (arg0))))
        {
          unsigned int shiftc = tree_low_cst (TREE_OPERAND (arg0, 1), 1);
-         unsigned HOST_WIDE_INT mask
-           = tree_low_cst (arg1, TYPE_UNSIGNED (TREE_TYPE (arg1)));
+         unsigned HOST_WIDE_INT mask = TREE_INT_CST_LOW (arg1);
          unsigned HOST_WIDE_INT newmask, zerobits = 0;
          tree shift_type = TREE_TYPE (arg0);
 
index 0fcc4ea94a2ab64f671f55ac3079659d7cd09e69..130193ce878f2d6c3ef282189df5d56787e424f3 100644 (file)
@@ -432,7 +432,7 @@ expand_vector_divmod (gimple_stmt_iterator *gsi, tree type, tree op0,
       tree cst = VECTOR_CST_ELT (op1, i);
       unsigned HOST_WIDE_INT ml;
 
-      if (!host_integerp (cst, unsignedp) || integer_zerop (cst))
+      if (TREE_CODE (cst) != INTEGER_CST || integer_zerop (cst))
        return NULL_TREE;
       pre_shifts[i] = 0;
       post_shifts[i] = 0;
@@ -453,7 +453,7 @@ expand_vector_divmod (gimple_stmt_iterator *gsi, tree type, tree op0,
       if (unsignedp)
        {
          unsigned HOST_WIDE_INT mh;
-         unsigned HOST_WIDE_INT d = tree_low_cst (cst, 1) & mask;
+         unsigned HOST_WIDE_INT d = TREE_INT_CST_LOW (cst) & mask;
 
          if (d >= ((unsigned HOST_WIDE_INT) 1 << (prec - 1)))
            /* FIXME: Can transform this into op0 >= op1 ? 1 : 0.  */
@@ -523,7 +523,7 @@ expand_vector_divmod (gimple_stmt_iterator *gsi, tree type, tree op0,
        }
       else
        {
-         HOST_WIDE_INT d = tree_low_cst (cst, 0);
+         HOST_WIDE_INT d = TREE_INT_CST_LOW (cst);
          unsigned HOST_WIDE_INT abs_d;
 
          if (d == -1)
index 11f7beed3a096422e741e590962cccc042ddb05f..edf1e7eb2d9d738c32586a5df0aa3aaa94617850 100644 (file)
@@ -2065,9 +2065,8 @@ vect_recog_divmod_pattern (vec<gimple> *stmts,
       return pattern_stmt;
     }
 
-  if (!host_integerp (oprnd1, TYPE_UNSIGNED (itype))
-      || integer_zerop (oprnd1)
-      || prec > HOST_BITS_PER_WIDE_INT)
+  if (prec > HOST_BITS_PER_WIDE_INT
+      || integer_zerop (oprnd1))
     return NULL;
 
   if (!can_mult_highpart_p (TYPE_MODE (vectype), TYPE_UNSIGNED (itype)))
@@ -2079,8 +2078,8 @@ vect_recog_divmod_pattern (vec<gimple> *stmts,
     {
       unsigned HOST_WIDE_INT mh, ml;
       int pre_shift, post_shift;
-      unsigned HOST_WIDE_INT d = tree_low_cst (oprnd1, 1)
-                                & GET_MODE_MASK (TYPE_MODE (itype));
+      unsigned HOST_WIDE_INT d = (TREE_INT_CST_LOW (oprnd1)
+                                 & GET_MODE_MASK (TYPE_MODE (itype)));
       tree t1, t2, t3, t4;
 
       if (d >= ((unsigned HOST_WIDE_INT) 1 << (prec - 1)))
@@ -2196,7 +2195,7 @@ vect_recog_divmod_pattern (vec<gimple> *stmts,
     {
       unsigned HOST_WIDE_INT ml;
       int post_shift;
-      HOST_WIDE_INT d = tree_low_cst (oprnd1, 0);
+      HOST_WIDE_INT d = TREE_INT_CST_LOW (oprnd1);
       unsigned HOST_WIDE_INT abs_d;
       bool add = false;
       tree t1, t2, t3, t4;