aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2012-03-16 09:47:09 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2012-03-16 09:47:09 +0000
commitd2a12ae77fa3efbe2329f7126b4acc24c35ef401 (patch)
tree61b2d8308768796bdf3f7e0c34b84aa6cc0bae11 /gcc/varasm.c
parent20bfad56eb81a52c7449521282401c88deee391b (diff)
downloadgcc-d2a12ae77fa3efbe2329f7126b4acc24c35ef401.zip
gcc-d2a12ae77fa3efbe2329f7126b4acc24c35ef401.tar.gz
gcc-d2a12ae77fa3efbe2329f7126b4acc24c35ef401.tar.bz2
tree.h (TREE_VECTOR_CST_ELTS): Remove.
2012-03-16 Richard Guenther <rguenther@suse.de> * tree.h (TREE_VECTOR_CST_ELTS): Remove. (VECTOR_CST_NELTS, VECTOR_CST_ELTS, VECTOR_CST_ELT): New defines. (struct tree_vector): Remove elements member, add variable size elts array member. (build_vector_stat): Declare. (build_vector): Define in terms of build_vector_stat. * tree.c (build_vector): Rename to ... (build_vector_stat): ... this. Take array of trees as parameter. (build_vector_from_ctor): Adjust. (integer_zerop, integer_onep, integer_all_onesp, iterative_hash_expr, initializer_zerop): Adjust. * cfgexpand.c (expand_debug_expr): Likewise. * expr.c (categorize_ctor_elements_1, expand_expr_real_1, const_vector_from_tree): Likewise. * fold-const.c (const_binop, operand_equal_p, native_encode_vector, native_interpret_vector, fold_unary_loc, vec_cst_ctor_to_array, fold_vec_perm, fold_binary_loc, fold_ternary_loc): Likewise. * tree-streamer-in.c (streamer_alloc_tree): Handle TS_VECTOR. (lto_input_ts_vector_tree_pointers): Adjust. * tree-streamer-out.c (streamer_write_tree_header): Handle TS_VECTOR. (write_ts_vector_tree_pointers): Adjust. * varasm.c (const_hash_1, compare_constant, copy_constant, output_constant): Adjust. * gimple-fold.c (gimple_fold_stmt_to_constant_1): Adjust. * print-tree.c (print_node): Adjust. * tree-pretty-print.c (dump_generic_node): Adjust. * tree-vect-generic.c (uniform_vector_p, vector_element, lower_vec_perm): Adjust. * tree-vect-loop.c (get_initial_def_for_reduction): Adjust. * tree-vect-slp.c (vect_get_constant_vectors, vect_transform_slp_perm_load): Adjust. * tree-vect-stmts.c (vect_gen_perm_mask): Adjust. * expmed.c (make_tree): Adjust. * config/i386/i386.c (ix86_expand_builtin): Adjust. * config/sparc/sparc.c (sparc_handle_vis_mul8x16): Adjust interface and implementation. (sparc_fold_builtin): Adjust. c-family/ * c-pretty-print.c (pp_c_initializer_list): Adjust. From-SVN: r185458
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c39
1 files changed, 15 insertions, 24 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 79c81fa..9bead9b 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -2706,12 +2706,12 @@ const_hash_1 (const tree exp)
case VECTOR_CST:
{
- tree link;
+ unsigned i;
- hi = 7 + TYPE_VECTOR_SUBPARTS (TREE_TYPE (exp));
+ hi = 7 + VECTOR_CST_NELTS (exp);
- for (link = TREE_VECTOR_CST_ELTS (exp); link; link = TREE_CHAIN (link))
- hi = hi * 563 + const_hash_1 (TREE_VALUE (link));
+ for (i = 0; i < VECTOR_CST_NELTS (exp); ++i)
+ hi = hi * 563 + const_hash_1 (VECTOR_CST_ELT (exp, i));
return hi;
}
@@ -2846,21 +2846,15 @@ compare_constant (const tree t1, const tree t2)
case VECTOR_CST:
{
- tree link1, link2;
+ unsigned i;
- if (TYPE_VECTOR_SUBPARTS (TREE_TYPE (t1))
- != TYPE_VECTOR_SUBPARTS (TREE_TYPE (t2)))
+ if (VECTOR_CST_NELTS (t1) != VECTOR_CST_NELTS (t2))
return 0;
- link2 = TREE_VECTOR_CST_ELTS (t2);
- for (link1 = TREE_VECTOR_CST_ELTS (t1);
- link1;
- link1 = TREE_CHAIN (link1))
- {
- if (!compare_constant (TREE_VALUE (link1), TREE_VALUE (link2)))
- return 0;
- link2 = TREE_CHAIN (link2);
- }
+ for (i = 0; i < VECTOR_CST_NELTS (t1); ++i)
+ if (!compare_constant (VECTOR_CST_ELT (t1, i),
+ VECTOR_CST_ELT (t2, i)))
+ return 0;
return 1;
}
@@ -3014,8 +3008,7 @@ copy_constant (tree exp)
copy_constant (TREE_OPERAND (exp, 0)));
case VECTOR_CST:
- return build_vector (TREE_TYPE (exp),
- copy_list (TREE_VECTOR_CST_ELTS (exp)));
+ return build_vector (TREE_TYPE (exp), VECTOR_CST_ELTS (exp));
case CONSTRUCTOR:
{
@@ -4595,8 +4588,7 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
case VECTOR_CST:
{
int elt_size;
- tree link;
- unsigned int nalign;
+ unsigned int i, nalign;
enum machine_mode inner;
inner = TYPE_MODE (TREE_TYPE (TREE_TYPE (exp)));
@@ -4604,12 +4596,11 @@ output_constant (tree exp, unsigned HOST_WIDE_INT size, unsigned int align)
elt_size = GET_MODE_SIZE (inner);
- link = TREE_VECTOR_CST_ELTS (exp);
- output_constant (TREE_VALUE (link), elt_size, align);
+ output_constant (VECTOR_CST_ELT (exp, 0), elt_size, align);
thissize = elt_size;
- while ((link = TREE_CHAIN (link)) != NULL)
+ for (i = 1; i < VECTOR_CST_NELTS (exp); ++i)
{
- output_constant (TREE_VALUE (link), elt_size, nalign);
+ output_constant (VECTOR_CST_ELT (exp, i), elt_size, nalign);
thissize += elt_size;
}
break;