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
This commit is contained in:
Dorit Nuzman 2007-03-17 14:43:30 +00:00 committed by Dorit Nuzman
parent 44d974b5d2
commit c492dc9a66
4 changed files with 50 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2007-03-17 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/31041
* tree-vect-transform.c (get_initial_def_for_induction): Call
force_gimple_operand.
2007-03-17 Olga Golovanevsky <olga@il.ibm.com>
* ipa-type-escape.c (look_for_casts) : Revert code to use

View File

@ -1,3 +1,8 @@
2007-03-17 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/31041
* gcc.dg/vect/pr31041.c: New test.
2007-03-16 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
* g++.dg/warn/Wconversion-integer.C: New

View File

@ -0,0 +1,27 @@
/* { dg-do compile } */
/* { dg-require-effective-target vect_int } */
#include <stdarg.h>
#include "tree-vect.h"
typedef int int32_t;
struct UNewTrie
{
int32_t index[(0x110000 >> 1)];
};
typedef struct UNewTrie UNewTrie;
utrie_open_3_4 ()
{
UNewTrie *trie;
int32_t i, j;
{
i = 0;
do
{
trie->index[i++] = j;
j += 1;
}
while (i < 5);
}
}
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -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);