]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
coverage.c (get_gcov_type): Use type_for_mode.
authorRichard Guenther <rguenther@suse.de>
Wed, 7 Mar 2012 14:31:40 +0000 (14:31 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 7 Mar 2012 14:31:40 +0000 (14:31 +0000)
2012-03-07  Richard Guenther  <rguenther@suse.de>

* coverage.c (get_gcov_type): Use type_for_mode.
(get_gcov_unsigned_t): Likewise.
* expr.c (store_constructor): Use type_for_mode.
(try_casesi): Likewise.
* tree-ssa-loop-ivopts.c (add_standard_iv_candidates_for_size):
Remove.
(add_standard_iv_candidates): Use standard type trees.
* dojump.c (do_jump): Remove dead code.

From-SVN: r185048

gcc/ChangeLog
gcc/coverage.c
gcc/dojump.c
gcc/expr.c
gcc/tree-ssa-loop-ivopts.c

index 38c1cf9c7614d7749627973a6bb9b9b6aab784e8..3e5e76d99b4e6fadd3d8614faa96209e88f7df6b 100644 (file)
@@ -1,3 +1,14 @@
+2012-03-07  Richard Guenther  <rguenther@suse.de>
+
+       * coverage.c (get_gcov_type): Use type_for_mode.
+       (get_gcov_unsigned_t): Likewise.
+       * expr.c (store_constructor): Use type_for_mode.
+       (try_casesi): Likewise.
+       * tree-ssa-loop-ivopts.c (add_standard_iv_candidates_for_size):
+       Remove.
+       (add_standard_iv_candidates): Use standard type trees.
+       * dojump.c (do_jump): Remove dead code.
+
 2012-03-07  Richard Guenther  <rguenther@suse.de>
 
        * c-typeck.c (pointer_diff): Use c_common_type_for_size.
index ce8b175d2f72a23dbf2a66aabb9daca749dffd40..14fe52f404becb4ceb80c760a58a15b8f575d33f 100644 (file)
@@ -131,7 +131,8 @@ static void coverage_obj_finish (VEC(constructor_elt,gc) *);
 tree
 get_gcov_type (void)
 {
-  return lang_hooks.types.type_for_size (GCOV_TYPE_SIZE, false);
+  enum machine_mode mode = smallest_mode_for_size (GCOV_TYPE_SIZE, MODE_INT);
+  return lang_hooks.types.type_for_mode (mode, false);
 }
 
 /* Return the type node for gcov_unsigned_t.  */
@@ -139,7 +140,8 @@ get_gcov_type (void)
 static tree
 get_gcov_unsigned_t (void)
 {
-  return lang_hooks.types.type_for_size (32, true);
+  enum machine_mode mode = smallest_mode_for_size (32, MODE_INT);
+  return lang_hooks.types.type_for_mode (mode, true);
 }
 \f
 static hashval_t
index 91bebee1400b823edb160a2ff6f5b70a960f1b1a..67452005e90837d4850259c3ff58bc130d4903c5 100644 (file)
@@ -444,36 +444,6 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label, int prob)
       /* Lowered by gimplify.c.  */
       gcc_unreachable ();
 
-    case COMPONENT_REF:
-    case BIT_FIELD_REF:
-    case ARRAY_REF:
-    case ARRAY_RANGE_REF:
-      {
-        HOST_WIDE_INT bitsize, bitpos;
-        int unsignedp;
-        enum machine_mode mode;
-        tree type;
-        tree offset;
-        int volatilep = 0;
-
-        /* Get description of this reference.  We don't actually care
-           about the underlying object here.  */
-        get_inner_reference (exp, &bitsize, &bitpos, &offset, &mode,
-                             &unsignedp, &volatilep, false);
-
-        type = lang_hooks.types.type_for_size (bitsize, unsignedp);
-        if (! SLOW_BYTE_ACCESS
-            && type != 0 && bitsize >= 0
-            && TYPE_PRECISION (type) < TYPE_PRECISION (TREE_TYPE (exp))
-            && have_insn_for (COMPARE, TYPE_MODE (type)))
-          {
-           do_jump (fold_convert (type, exp), if_false_label, if_true_label,
-                    prob);
-            break;
-          }
-        goto normal;
-      }
-
     case MINUS_EXPR:
       /* Nonzero iff operands of minus differ.  */
       code = NE_EXPR;
index a3ace7ad0f0c2422d6ebe642cdbb84aa60f72d8b..e6fc100f9f8f7330778f4c35698aabd7f2840c04 100644 (file)
@@ -5893,8 +5893,8 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
 
                if (TYPE_PRECISION (type) < BITS_PER_WORD)
                  {
-                   type = lang_hooks.types.type_for_size
-                     (BITS_PER_WORD, TYPE_UNSIGNED (type));
+                   type = lang_hooks.types.type_for_mode
+                     (word_mode, TYPE_UNSIGNED (type));
                    value = fold_convert (type, value);
                  }
 
@@ -10726,7 +10726,6 @@ try_casesi (tree index_type, tree index_expr, tree minval, tree range,
 {
   struct expand_operand ops[5];
   enum machine_mode index_mode = SImode;
-  int index_bits = GET_MODE_BITSIZE (index_mode);
   rtx op1, op2, index;
 
   if (! HAVE_casesi)
@@ -10753,7 +10752,7 @@ try_casesi (tree index_type, tree index_expr, tree minval, tree range,
     {
       if (TYPE_MODE (index_type) != index_mode)
        {
-         index_type = lang_hooks.types.type_for_size (index_bits, 0);
+         index_type = lang_hooks.types.type_for_mode (index_mode, 0);
          index_expr = fold_convert (index_type, index_expr);
        }
 
index 10c9352599ad36a4a414a0e6a86efdcdd05a81e8..527c911e4a71edcd74ac0d8aad0a89d13e6d8a74 100644 (file)
@@ -2405,28 +2405,26 @@ add_candidate (struct ivopts_data *data,
     add_autoinc_candidates (data, base, step, important, use);
 }
 
-/* Add a standard "0 + 1 * iteration" iv candidate for a
-   type with SIZE bits.  */
-
-static void
-add_standard_iv_candidates_for_size (struct ivopts_data *data,
-                                    unsigned int size)
-{
-  tree type = lang_hooks.types.type_for_size (size, true);
-  add_candidate (data, build_int_cst (type, 0), build_int_cst (type, 1),
-                true, NULL);
-}
-
 /* Adds standard iv candidates.  */
 
 static void
 add_standard_iv_candidates (struct ivopts_data *data)
 {
-  add_standard_iv_candidates_for_size (data, INT_TYPE_SIZE);
+  add_candidate (data, integer_zero_node, integer_one_node, true, NULL);
+
+  /* The same for a double-integer type if it is still fast enough.  */
+  if (TYPE_PRECISION
+        (long_integer_type_node) > TYPE_PRECISION (integer_type_node)
+      && TYPE_PRECISION (long_integer_type_node) <= BITS_PER_WORD)
+    add_candidate (data, build_int_cst (long_integer_type_node, 0),
+                  build_int_cst (long_integer_type_node, 1), true, NULL);
 
   /* The same for a double-integer type if it is still fast enough.  */
-  if (BITS_PER_WORD >= INT_TYPE_SIZE * 2)
-    add_standard_iv_candidates_for_size (data, INT_TYPE_SIZE * 2);
+  if (TYPE_PRECISION
+        (long_long_integer_type_node) > TYPE_PRECISION (long_integer_type_node)
+      && TYPE_PRECISION (long_long_integer_type_node) <= BITS_PER_WORD)
+    add_candidate (data, build_int_cst (long_long_integer_type_node, 0),
+                  build_int_cst (long_long_integer_type_node, 1), true, NULL);
 }