]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
forwprop: Use lhs type instead of arg0 in folding VEC_PERM_EXPR.
authorPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Tue, 19 Jul 2022 12:13:26 +0000 (17:43 +0530)
committerPrathamesh Kulkarni <prathamesh.kulkarni@linaro.org>
Tue, 19 Jul 2022 12:15:41 +0000 (17:45 +0530)
gcc/ChangeLog:

* tree-ssa-forwprop.cc (simplify_permutation): Use lhs type
instead of TREE_TYPE (arg0) as result type in folding VEC_PERM_EXPR.

gcc/tree-ssa-forwprop.cc

index fdc4bc8909d2763876550e53277ff2b3dcca796a..d04cf4bccf8b18cd6d6bd773d93ae360272a3d59 100644 (file)
@@ -2661,7 +2661,7 @@ simplify_permutation (gimple_stmt_iterator *gsi)
 
       /* Shuffle of a constructor.  */
       bool ret = false;
-      tree res_type = TREE_TYPE (arg0);
+      tree res_type = TREE_TYPE (gimple_assign_lhs (stmt));
       tree opt = fold_ternary (VEC_PERM_EXPR, res_type, arg0, arg1, op2);
       if (!opt
          || (TREE_CODE (opt) != CONSTRUCTOR && TREE_CODE (opt) != VECTOR_CST))