aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-vect-stmts.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-11-04 12:42:57 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-11-04 12:42:57 +0000
commit2a2651b797f11a4dbe0fb9d9e75a7ca672f934de (patch)
treeccda1c1f02abf3b791d60aa9ead2d5e0fd2251a3 /gcc/tree-vect-stmts.c
parentbf9412cda74bd81b71a2d459fae173a4ed974c07 (diff)
downloadgcc-2a2651b797f11a4dbe0fb9d9e75a7ca672f934de.zip
gcc-2a2651b797f11a4dbe0fb9d9e75a7ca672f934de.tar.gz
gcc-2a2651b797f11a4dbe0fb9d9e75a7ca672f934de.tar.bz2
re PR tree-optimization/45733 (ICE: verify_stmts failed: invalid conversion in gimple call with -fstrict-overflow -ftree-vectorize)
2010-11-04 Richard Guenther <rguenther@suse.de> PR tree-optimization/45733 * tree-vect-stmts.c (reverse_vec_elements): Honor the permute builtins function return type. * gcc.dg/pr45733.c: New testcase. From-SVN: r166308
Diffstat (limited to 'gcc/tree-vect-stmts.c')
-rw-r--r--gcc/tree-vect-stmts.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c
index 2dbc035..3d18dfe 100644
--- a/gcc/tree-vect-stmts.c
+++ b/gcc/tree-vect-stmts.c
@@ -3742,8 +3742,19 @@ reverse_vec_elements (tree x, gimple stmt, gimple_stmt_iterator *gsi)
/* Generate the permute statement. */
perm_stmt = gimple_build_call (builtin_decl, 3, x, x, mask_vec);
+ if (!useless_type_conversion_p (vectype,
+ TREE_TYPE (TREE_TYPE (builtin_decl))))
+ {
+ tree tem = create_tmp_reg (TREE_TYPE (TREE_TYPE (builtin_decl)), NULL);
+ tem = make_ssa_name (tem, perm_stmt);
+ gimple_call_set_lhs (perm_stmt, tem);
+ vect_finish_stmt_generation (stmt, perm_stmt, gsi);
+ perm_stmt = gimple_build_assign (NULL_TREE,
+ build1 (VIEW_CONVERT_EXPR,
+ vectype, tem));
+ }
data_ref = make_ssa_name (perm_dest, perm_stmt);
- gimple_call_set_lhs (perm_stmt, data_ref);
+ gimple_set_lhs (perm_stmt, data_ref);
vect_finish_stmt_generation (stmt, perm_stmt, gsi);
return data_ref;