From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2153) id A0ACA3839819; Thu, 17 Jun 2021 05:59:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0ACA3839819 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jakub Jelinek To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8594] expr: Fix up VEC_PACK_TRUNC_EXPR expansion [PR101046] X-Act-Checkin: gcc X-Git-Author: Jakub Jelinek X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 8cd45af39ddc14fc77017a2d4c2aceb9a915ab4b X-Git-Newrev: 5ece5ac99e804cccc3d8534d8871eb72e08edb06 Message-Id: <20210617055944.A0ACA3839819@sourceware.org> Date: Thu, 17 Jun 2021 05:59:44 +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: Thu, 17 Jun 2021 05:59:44 -0000 https://gcc.gnu.org/g:5ece5ac99e804cccc3d8534d8871eb72e08edb06 commit r11-8594-g5ece5ac99e804cccc3d8534d8871eb72e08edb06 Author: Jakub Jelinek Date: Tue Jun 15 11:36:47 2021 +0200 expr: Fix up VEC_PACK_TRUNC_EXPR expansion [PR101046] The following testcase ICEs, because we have a mode mismatch. VEC_PACK_TRUNC_EXPR's operands have different modes from the result (same vector mode size but twice as large element), but we were passing non-NULL subtarget with the mode of the result to the expansion of its arguments, so the VEC_PERM_EXPR in one of the operands which had V8SImode operands and result had V16HImode target. Fixed by clearing the subtarget if we are changing mode. 2021-06-15 Jakub Jelinek PR target/101046 * expr.c (expand_expr_real_2) : Clear subtarget when changing mode. (cherry picked from commit 008153c8435ca3bf587e11654c31f05c0f99b43a) Diff: --- gcc/expr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/expr.c b/gcc/expr.c index a0e19465965..14a25c25450 100644 --- a/gcc/expr.c +++ b/gcc/expr.c @@ -9809,6 +9809,7 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, case VEC_PACK_SAT_EXPR: case VEC_PACK_FIX_TRUNC_EXPR: mode = TYPE_MODE (TREE_TYPE (treeop0)); + subtarget = NULL_RTX; goto binop; case VEC_PACK_TRUNC_EXPR: @@ -9832,6 +9833,7 @@ expand_expr_real_2 (sepops ops, rtx target, machine_mode tmode, return eops[0].value; } mode = TYPE_MODE (TREE_TYPE (treeop0)); + subtarget = NULL_RTX; goto binop; case VEC_PACK_FLOAT_EXPR: