From: Prathamesh Kulkarni Date: Tue, 19 Jul 2022 12:13:26 +0000 (+0530) Subject: forwprop: Use lhs type instead of arg0 in folding VEC_PERM_EXPR. X-Git-Tag: basepoints/gcc-14~5462 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c3231302577445417715a7c22e879e4159376d3;p=thirdparty%2Fgcc.git forwprop: Use lhs type instead of arg0 in folding VEC_PERM_EXPR. gcc/ChangeLog: * tree-ssa-forwprop.cc (simplify_permutation): Use lhs type instead of TREE_TYPE (arg0) as result type in folding VEC_PERM_EXPR. --- diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index fdc4bc8909d..d04cf4bccf8 100644 --- a/gcc/tree-ssa-forwprop.cc +++ b/gcc/tree-ssa-forwprop.cc @@ -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))