diff options
author | Dorit Nuzman <dorit@il.ibm.com> | 2007-03-17 14:43:30 +0000 |
---|---|---|
committer | Dorit Nuzman <dorit@gcc.gnu.org> | 2007-03-17 14:43:30 +0000 |
commit | c492dc9a666e438ca8bbd2052482e8c30d8b5019 (patch) | |
tree | ccf362c05136dde7e56af2263a798328ffa1b61a /gcc/tree-vect-transform.c | |
parent | 44d974b5d205b10a3f4636de4fa9c4a2198b3a10 (diff) | |
download | gcc-c492dc9a666e438ca8bbd2052482e8c30d8b5019.zip gcc-c492dc9a666e438ca8bbd2052482e8c30d8b5019.tar.gz gcc-c492dc9a666e438ca8bbd2052482e8c30d8b5019.tar.bz2 |
re PR tree-optimization/31041 (verify_stmts failed: invalid operand to binary operator with -O2 -ftree-vectorize)
PR tree-optimization/31041
* tree-vect-transform.c (get_initial_def_for_induction): Call
force_gimple_operand.
From-SVN: r123023
Diffstat (limited to 'gcc/tree-vect-transform.c')
-rw-r--r-- | gcc/tree-vect-transform.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index 6938841..bddea1e 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -548,6 +548,7 @@ get_initial_def_for_induction (tree stmt, tree iv_phi) int ncopies = vf / nunits; tree expr; stmt_vec_info phi_info = vinfo_for_stmt (iv_phi); + tree stmts; gcc_assert (phi_info); @@ -575,16 +576,23 @@ get_initial_def_for_induction (tree stmt, tree iv_phi) gcc_assert (ok); /* Create the vector that holds the initial_value of the induction. */ - new_name = init_expr; + new_var = vect_get_new_vect_var (scalar_type, vect_scalar_var, "var_"); + add_referenced_var (new_var); + + new_name = force_gimple_operand (init_expr, &stmts, false, new_var); + if (stmts) + { + new_bb = bsi_insert_on_edge_immediate (pe, stmts); + gcc_assert (!new_bb); + } + t = NULL_TREE; - t = tree_cons (NULL_TREE, init_expr, t); + t = tree_cons (NULL_TREE, new_name, t); for (i = 1; i < nunits; i++) { tree tmp; /* Create: new_name = new_name + step_expr */ - new_var = vect_get_new_vect_var (scalar_type, vect_scalar_var, "var_"); - add_referenced_var (new_var); tmp = fold_build2 (PLUS_EXPR, scalar_type, new_name, step_expr); init_stmt = build_gimple_modify_stmt (new_var, tmp); new_name = make_ssa_name (new_var, init_stmt); |