From patchwork Thu Jun 18 12:47:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1312066 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49nhY05YMRz9sSF for ; Thu, 18 Jun 2020 22:47:32 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 75D553939C08; Thu, 18 Jun 2020 12:47:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by sourceware.org (Postfix) with ESMTPS id 031183898523 for ; Thu, 18 Jun 2020 12:47:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 031183898523 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rguenther@suse.de X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 6C3D0ACA7 for ; Thu, 18 Jun 2020 12:47:25 +0000 (UTC) Date: Thu, 18 Jun 2020 14:47:25 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] middle-end/95739 - fix vector condition IFN expansion Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-14.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" This fixes the omission of moving the expansion result to the target. Bootstrapped and tested on x86_64-unknown-linux-gnu, fixes the observed -m32 FAIL. 2020-06-18 Richard Biener PR middle-end/95739 * internal-fn.c (expand_vect_cond_optab_fn): Move the result to the target if necessary. (expand_vect_cond_mask_optab_fn): Likewise. --- gcc/internal-fn.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c index 644f234e087..2329e3db22f 100644 --- a/gcc/internal-fn.c +++ b/gcc/internal-fn.c @@ -2589,6 +2589,8 @@ expand_vect_cond_optab_fn (internal_fn, gcall *stmt, convert_optab optab) create_fixed_operand (&ops[4], XEXP (comparison, 0)); create_fixed_operand (&ops[5], XEXP (comparison, 1)); expand_insn (icode, 6, ops); + if (!rtx_equal_p (ops[0].value, target)) + emit_move_insn (target, ops[0].value); } #define expand_vec_cond_optab_fn expand_vect_cond_optab_fn @@ -2629,6 +2631,8 @@ expand_vect_cond_mask_optab_fn (internal_fn, gcall *stmt, convert_optab optab) create_input_operand (&ops[2], rtx_op2, mode); create_input_operand (&ops[3], mask, mask_mode); expand_insn (icode, 4, ops); + if (!rtx_equal_p (ops[0].value, target)) + emit_move_insn (target, ops[0].value); } #define expand_vec_cond_mask_optab_fn expand_vect_cond_mask_optab_fn