aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2022-09-06 15:18:04 +0530
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>2022-09-06 15:18:22 +0530
commite55674b86a10e695cea2f45c0472402b97cc2dfb (patch)
treec89931a33909d8011833e8c6cbf1962d6e65dda2
parent1a4e1425f8498580994e32ceb3c50bd52616a82d (diff)
downloadgcc-e55674b86a10e695cea2f45c0472402b97cc2dfb.zip
gcc-e55674b86a10e695cea2f45c0472402b97cc2dfb.tar.gz
gcc-e55674b86a10e695cea2f45c0472402b97cc2dfb.tar.bz2
tree-ssa-forwprop.cc: Adjust res_type when operands have differing vector lengths.
gcc/ * tree-ssa-forwprop.cc (simplify_permutation): Set res_type to a vector type with same element type as arg0, and length as op2.
-rw-r--r--gcc/tree-ssa-forwprop.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc
index fdc4bc8..4b693ef 100644
--- a/gcc/tree-ssa-forwprop.cc
+++ b/gcc/tree-ssa-forwprop.cc
@@ -2661,7 +2661,9 @@ simplify_permutation (gimple_stmt_iterator *gsi)
/* Shuffle of a constructor. */
bool ret = false;
- tree res_type = TREE_TYPE (arg0);
+ tree res_type
+ = build_vector_type (TREE_TYPE (TREE_TYPE (arg0)),
+ TYPE_VECTOR_SUBPARTS (TREE_TYPE (op2)));
tree opt = fold_ternary (VEC_PERM_EXPR, res_type, arg0, arg1, op2);
if (!opt
|| (TREE_CODE (opt) != CONSTRUCTOR && TREE_CODE (opt) != VECTOR_CST))