coverage.c (get_gcov_type): Use type_for_mode.
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
This commit is contained in:
parent
647d4b7512
commit
0f2508394b
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
static hashval_t
|
||||
|
|
30
gcc/dojump.c
30
gcc/dojump.c
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 (BITS_PER_WORD >= INT_TYPE_SIZE * 2)
|
||||
add_standard_iv_candidates_for_size (data, INT_TYPE_SIZE * 2);
|
||||
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 (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);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue