From patchwork Thu Nov 26 15:16:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1406733 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 4ChhDq1Rycz9sSs for ; Fri, 27 Nov 2020 02:16:41 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 237C9388A40E; Thu, 26 Nov 2020 15:16:39 +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 A32043857C4F for ; Thu, 26 Nov 2020 15:16:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A32043857C4F 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.221.27]) by mx2.suse.de (Postfix) with ESMTP id 60EBAACE0 for ; Thu, 26 Nov 2020 15:16:35 +0000 (UTC) Date: Thu, 26 Nov 2020 16:16:34 +0100 (CET) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/98015 - fix VEC_COND_EXPR lowering condition Message-ID: User-Agent: Alpine 2.21 (LSU 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-11.3 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 condition to match the comment and only lower VECTOR_BOOLEAN_TYPE_P VEC_COND_EXPRs. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2020-11-26 Richard Biener * gimple-isel.c (gimple_expand_vec_cond_expr): Only lower VECTOR_BOOLEAN_TYPE_P VEC_COND_EXPRs. --- gcc/gimple-isel.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/gimple-isel.cc b/gcc/gimple-isel.cc index 83281c0cbf9..048b407bd11 100644 --- a/gcc/gimple-isel.cc +++ b/gcc/gimple-isel.cc @@ -139,10 +139,10 @@ gimple_expand_vec_cond_expr (gimple_stmt_iterator *gsi, Those can end up generated by folding and at least for integer mode masks we cannot expect vcond expanders to exist. We lower a ? b : c to (b & a) | (c & ~a). */ - if (!VECTOR_MODE_P (mode)) + if (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (lhs)) + && !VECTOR_MODE_P (mode)) { - gcc_assert (VECTOR_BOOLEAN_TYPE_P (TREE_TYPE (lhs)) - && types_compatible_p (TREE_TYPE (op0), TREE_TYPE (op1))); + gcc_assert (types_compatible_p (TREE_TYPE (op0), TREE_TYPE (op1))); gimple_seq stmts = NULL; tree type = TREE_TYPE (lhs); location_t loc = gimple_location (stmt);