aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2012-09-18 15:03:09 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2012-09-18 15:03:09 +0200
commit1d61ee4252f7b906b37bb284e3b4616ebe61eaf6 (patch)
treec2579f37de05ea800ee4f7725ecdcacb4e090e03 /gcc/tree-ssa-forwprop.c
parent6889a65081852d52914d24abd76f3a227a2929c5 (diff)
downloadgcc-1d61ee4252f7b906b37bb284e3b4616ebe61eaf6.zip
gcc-1d61ee4252f7b906b37bb284e3b4616ebe61eaf6.tar.gz
gcc-1d61ee4252f7b906b37bb284e3b4616ebe61eaf6.tar.bz2
re PR tree-optimization/54610 (FAIL: gcc.dg/tree-ssa/forwprop-22.c (internal compiler error) on x86 AVX targets)
PR tree-optimization/54610 * tree-ssa-forwprop.c: Include optabs.h. Don't include tree-vectorizer.h. (simplify_vector_constructor): Don't use vect_gen_perm_mask, instead create the mask constant here. * Makefile.in (tree-ssa-forwprop.o): Depend on $(OPTABS_H). Don't depend on $(TREE_VECTORIZER_H). * gcc.target/i386/pr54610.c: New test. From-SVN: r191421
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index 2d17bfa..a162832 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -33,7 +33,7 @@ along with GCC; see the file COPYING3. If not see
#include "gimple.h"
#include "expr.h"
#include "cfgloop.h"
-#include "tree-vectorizer.h"
+#include "optabs.h"
/* This pass propagates the RHS of assignment statements into use
sites of the LHS of the assignment. It's basically a specialized
@@ -2854,14 +2854,24 @@ simplify_vector_constructor (gimple_stmt_iterator *gsi)
return false;
if (maybe_ident)
- {
- gimple_assign_set_rhs_from_tree (gsi, orig);
- }
+ gimple_assign_set_rhs_from_tree (gsi, orig);
else
{
- op2 = vect_gen_perm_mask (type, sel);
- if (!op2)
+ tree mask_type, *mask_elts;
+
+ if (!can_vec_perm_p (TYPE_MODE (type), false, sel))
+ return false;
+ mask_type
+ = build_vector_type (build_nonstandard_integer_type (elem_size, 1),
+ nelts);
+ if (GET_MODE_CLASS (TYPE_MODE (mask_type)) != MODE_VECTOR_INT
+ || GET_MODE_SIZE (TYPE_MODE (mask_type))
+ != GET_MODE_SIZE (TYPE_MODE (type)))
return false;
+ mask_elts = XALLOCAVEC (tree, nelts);
+ for (i = 0; i < nelts; i++)
+ mask_elts[i] = build_int_cst (TREE_TYPE (mask_type), sel[i]);
+ op2 = build_vector (mask_type, mask_elts);
gimple_assign_set_rhs_with_ops_1 (gsi, VEC_PERM_EXPR, orig, orig, op2);
}
update_stmt (gsi_stmt (*gsi));