From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1922) id B3CD738582AD; Tue, 6 Sep 2022 09:51:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3CD738582AD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1662457886; bh=bV35E7SqYlHMrId2u3erlGLca+5EfScXtpxtUuC0Sp8=; h=From:To:Subject:Date:From; b=FoDT1g1x3lkurGeqWzujHAiYHH3RnNRPojKKHngeeKn8pEP3AsO3ijsZQ9pJVb6p8 lxjUMCaZ2z1LBrpF+7pexnYi/Qb/OtUpMdbvdeO0FiOK/OZ/U3xvesISNME0IKhaX3 WBDNSQJMAuU0uNEZzho/VBhDbU1NWLrGrKI0G1dk= 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-2494] tree-ssa-forwprop.cc: Adjust res_type when operands have differing vector lengths. X-Act-Checkin: gcc X-Git-Author: Prathamesh Kulkarni X-Git-Refname: refs/heads/master X-Git-Oldrev: 1a4e1425f8498580994e32ceb3c50bd52616a82d X-Git-Newrev: e55674b86a10e695cea2f45c0472402b97cc2dfb Message-Id: <20220906095126.B3CD738582AD@sourceware.org> Date: Tue, 6 Sep 2022 09:51:26 +0000 (GMT) List-Id: https://gcc.gnu.org/g:e55674b86a10e695cea2f45c0472402b97cc2dfb commit r13-2494-ge55674b86a10e695cea2f45c0472402b97cc2dfb Author: Prathamesh Kulkarni Date: Tue Sep 6 15:18:04 2022 +0530 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. Diff: --- gcc/tree-ssa-forwprop.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gcc/tree-ssa-forwprop.cc b/gcc/tree-ssa-forwprop.cc index fdc4bc8909d..4b693ef095c 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))