diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-07 14:31:40 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-03-07 14:31:40 +0000 |
commit | 1b3c3119971d15769babdee619abcca551fbe7ad (patch) | |
tree | 9367ae3ff084cabf2d89d91b25e317ab9c681ccc | |
parent | 3c9b85aa8f5bccac8161ee7145c6bd8f95a5b846 (diff) | |
download | gcc-1b3c3119971d15769babdee619abcca551fbe7ad.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@185048 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 11 | ||||
-rw-r--r-- | gcc/coverage.c | 6 | ||||
-rw-r--r-- | gcc/dojump.c | 30 | ||||
-rw-r--r-- | gcc/expr.c | 7 | ||||
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 28 |
5 files changed, 31 insertions, 51 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 38c1cf9c761..3e5e76d99b4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,16 @@ 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> diff --git a/gcc/coverage.c b/gcc/coverage.c index ce8b175d2f7..14fe52f404b 100644 --- a/gcc/coverage.c +++ b/gcc/coverage.c @@ -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 diff --git a/gcc/dojump.c b/gcc/dojump.c index 91bebee1400..67452005e90 100644 --- a/gcc/dojump.c +++ b/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; diff --git a/gcc/expr.c b/gcc/expr.c index a3ace7ad0f0..e6fc100f9f8 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -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); } diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index 10c9352599a..527c911e4a7 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -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); } |