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.
2012-03-07 Richard Guenther <rguenther@suse.de>
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. */
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
/* 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;
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);
}
{
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)
{
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);
}
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);
}