aboutsummaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@codesourcery.com>2010-10-31 02:20:22 +0000
committerNathan Froyd <froydnj@gcc.gnu.org>2010-10-31 02:20:22 +0000
commitb9acc9f1de4ef8a1cff7c495a3b26fcd3e2448c4 (patch)
tree1690b9c80ac2985f27e7ba09fccad0152877304c /gcc/fold-const.c
parent76369a821b895c4d4bf1412d108716c4bb0a90de (diff)
downloadgcc-b9acc9f1de4ef8a1cff7c495a3b26fcd3e2448c4.zip
gcc-b9acc9f1de4ef8a1cff7c495a3b26fcd3e2448c4.tar.gz
gcc-b9acc9f1de4ef8a1cff7c495a3b26fcd3e2448c4.tar.bz2
fold-const.c (build_zero_vector): Use build_vector_from_val.
* fold-const.c (build_zero_vector): Use build_vector_from_val. * tree-vect-loop.c (get_initial_def_for_induction): Likewise. (get_initial_def_for_reduction): Likewise. * tree-vect-slp.c (vect_get_constant_vectors): Likewise. * tree-vect-stmts.c (vect_get_vec_def_for_operand): Likewise. * tree.c (build_one_cst): Likewise. (build_vector_from_val): Use types_compatible_p for assert. From-SVN: r166102
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index decb0fb..4599a69 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1796,16 +1796,10 @@ fold_convert_const (enum tree_code code, tree type, tree arg1)
static tree
build_zero_vector (tree type)
{
- tree elem, list;
- int i, units;
-
- elem = fold_convert_const (NOP_EXPR, TREE_TYPE (type), integer_zero_node);
- units = TYPE_VECTOR_SUBPARTS (type);
+ tree t;
- list = NULL_TREE;
- for (i = 0; i < units; i++)
- list = tree_cons (NULL_TREE, elem, list);
- return build_vector (type, list);
+ t = fold_convert_const (NOP_EXPR, TREE_TYPE (type), integer_zero_node);
+ return build_vector_from_val (type, t);
}
/* Returns true, if ARG is convertible to TYPE using a NOP_EXPR. */