From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1922) id 3C5233858281; Tue, 19 Jul 2022 12:16:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3C5233858281 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Prathamesh Kulkarni To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1745] forwprop: Use lhs type instead of arg0 in folding VEC_PERM_EXPR. X-Act-Checkin: gcc X-Git-Author: Prathamesh Kulkarni X-Git-Refname: refs/heads/master X-Git-Oldrev: f082bc79c104aa308cd4acca5bf3adffd46da355 X-Git-Newrev: 4c3231302577445417715a7c22e879e4159376d3 Message-Id: <20220719121616.3C5233858281@sourceware.org> Date: Tue, 19 Jul 2022 12:16:16 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2022 12:16:16 -0000 https://gcc.gnu.org/g:4c3231302577445417715a7c22e879e4159376d3 commit r13-1745-g4c3231302577445417715a7c22e879e4159376d3 Author: Prathamesh Kulkarni Date: Tue Jul 19 17:43:26 2022 +0530 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: --- gcc/tree-ssa-forwprop.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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))