2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-03-21 10:20:29 +08:00

re PR tree-optimization/33993 (ICE: verify_stmts failed (invalid reference prefix))

PR tree-optimization/33993
	* tree-vect-transform.c (vect_get_constant_vectors): Use build_vector
	rather than build_constructor_from_list if all list values are
	constants.
	(get_initial_def_for_induction): Use build_vector instead of
	build_constructor_from_list.

	* gcc.c-torture/compile/20071105-1.c: New test.

From-SVN: r129920
This commit is contained in:
Jakub Jelinek 2007-11-06 09:28:37 +01:00 committed by Jakub Jelinek
parent 239371f9c7
commit c563bcd1da
4 changed files with 38 additions and 3 deletions

@ -1,3 +1,12 @@
2007-11-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/33993
* tree-vect-transform.c (vect_get_constant_vectors): Use build_vector
rather than build_constructor_from_list if all list values are
constants.
(get_initial_def_for_induction): Use build_vector instead of
build_constructor_from_list.
2007-11-05 Mark Mitchell <mark@codesourcery.com>
PR target/33579

@ -1,3 +1,8 @@
2007-11-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/33993
* gcc.c-torture/compile/20071105-1.c: New test.
2007-11-05 Jakub Jelinek <jakub@redhat.com>
PR rtl-optimization/33648

@ -0,0 +1,11 @@
/* PR tree-optimization/33993 */
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
void
init_full (char *array, int ny)
{
int j;
char acc = 128;
for (j = 0; j < ny; j++)
*array++ = acc++;
}

@ -1318,6 +1318,7 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
bool is_store = false;
unsigned int number_of_vectors = SLP_TREE_NUMBER_OF_VEC_STMTS (slp_node);
VEC (tree, heap) *voprnds = VEC_alloc (tree, heap, number_of_vectors);
bool constant_p;
if (STMT_VINFO_DATA_REF (stmt_vinfo))
is_store = true;
@ -1341,6 +1342,7 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
number_of_copies = least_common_multiple (nunits, group_size) / group_size;
number_of_places_left_in_vector = nunits;
constant_p = true;
for (j = 0; j < number_of_copies; j++)
{
for (i = group_size - 1; VEC_iterate (tree, stmts, i, stmt); i--)
@ -1350,6 +1352,8 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
op = operation;
else
op = TREE_OPERAND (operation, op_num);
if (!CONSTANT_CLASS_P (op))
constant_p = false;
/* Create 'vect_ = {op0,op1,...,opn}'. */
t = tree_cons (NULL_TREE, op, t);
@ -1362,7 +1366,11 @@ vect_get_constant_vectors (slp_tree slp_node, VEC(tree,heap) **vec_oprnds,
vector_type = get_vectype_for_scalar_type (TREE_TYPE (op));
gcc_assert (vector_type);
vec_cst = build_constructor_from_list (vector_type, t);
if (constant_p)
vec_cst = build_vector (vector_type, t);
else
vec_cst = build_constructor_from_list (vector_type, t);
constant_p = true;
VEC_quick_push (tree, voprnds,
vect_init_vector (stmt, vec_cst, vector_type,
NULL));
@ -1617,7 +1625,8 @@ get_initial_def_for_induction (tree iv_phi)
t = NULL_TREE;
for (i = 0; i < nunits; i++)
t = tree_cons (NULL_TREE, unshare_expr (new_name), t);
vec = build_constructor_from_list (vectype, t);
gcc_assert (CONSTANT_CLASS_P (new_name));
vec = build_vector (vectype, t);
vec_step = vect_init_vector (iv_phi, vec, vectype, NULL);
@ -1673,7 +1682,8 @@ get_initial_def_for_induction (tree iv_phi)
t = NULL_TREE;
for (i = 0; i < nunits; i++)
t = tree_cons (NULL_TREE, unshare_expr (new_name), t);
vec = build_constructor_from_list (vectype, t);
gcc_assert (CONSTANT_CLASS_P (new_name));
vec = build_vector (vectype, t);
vec_step = vect_init_vector (iv_phi, vec, vectype, NULL);
vec_def = induc_def;