From patchwork Thu Dec 3 15:24:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1410475 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=pass (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=u1sB397v; dkim-atps=neutral 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 4Cn0Gz4R0Bz9sPB for ; Fri, 4 Dec 2020 02:33:29 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 04D643851C23; Thu, 3 Dec 2020 15:33:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 04D643851C23 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1607009607; bh=GOLJVRwei1e9AZO94+JUzHoNuP8fU50TbrofxbMXef4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u1sB397vx+W050sdi1qGOkOH6xx2sCQYFWf/XwCZ1WS6tV0Lt5mnslhLogKLsSgc5 q2IR5+sFvEnIM3AIW3XJJhBO2iNuYpCmZ/+XNaCGTsRBDhDBV6PG+K9duB4K3W+mV0 xXoxoxaACxaodEaJwYxjC9rMAtr2F/GMT2UyCG04= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 18693385803C for ; Thu, 3 Dec 2020 15:33:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 18693385803C Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B32781063 for ; Thu, 3 Dec 2020 07:33:24 -0800 (PST) Received: from localhost (unknown [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6B1793FA00 for ; Thu, 3 Dec 2020 07:24:35 -0800 (PST) To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [committed] aarch64: Don't fold svundef* at the gimple level Date: Thu, 03 Dec 2020 15:24:33 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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: , X-Patchwork-Original-From: Richard Sandiford via Gcc-patches From: Richard Sandiford Reply-To: Richard Sandiford Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" As the testcase shows, folding svundef*() at the gimple level has the unfortunate side-effect of introducing -Wuninitialized or -Wmaybe-uninitialized warnings. We don't have a testcase that relies on the fold, so the easiest fix seems to be to remove it. Tested on aarch64-linux-gnu and aarch64_be-elf, pushed. Thanks, Richard gcc/ * config/aarch64/aarch64-sve-builtins-base.cc (svundef_impl::fold): Delete. gcc/testsuite/ * gcc.target/aarch64/sve/acle/general/undef_1.c: New test. --- gcc/config/aarch64/aarch64-sve-builtins-base.cc | 11 ----------- .../gcc.target/aarch64/sve/acle/general/undef_1.c | 12 ++++++++++++ 2 files changed, 12 insertions(+), 11 deletions(-) create mode 100644 gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c diff --git a/gcc/config/aarch64/aarch64-sve-builtins-base.cc b/gcc/config/aarch64/aarch64-sve-builtins-base.cc index 9b63ea76ecd..4223125cd5e 100644 --- a/gcc/config/aarch64/aarch64-sve-builtins-base.cc +++ b/gcc/config/aarch64/aarch64-sve-builtins-base.cc @@ -2295,17 +2295,6 @@ public: CONSTEXPR svundef_impl (unsigned int vectors_per_tuple) : quiet (vectors_per_tuple) {} - gimple * - fold (gimple_folder &f) const OVERRIDE - { - /* Don't fold svundef at the gimple level. There's no exact - correspondence for SSA_NAMEs, and we explicitly don't want - to generate a specific value (like an all-zeros vector). */ - if (vectors_per_tuple () == 1) - return NULL; - return gimple_build_assign (f.lhs, build_clobber (TREE_TYPE (f.lhs))); - } - rtx expand (function_expander &e) const OVERRIDE { diff --git a/gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c new file mode 100644 index 00000000000..793593b662c --- /dev/null +++ b/gcc/testsuite/gcc.target/aarch64/sve/acle/general/undef_1.c @@ -0,0 +1,12 @@ +/* { dg-options "-O2 -W -Wall -Werror" } */ + +#include + +svfloat32x2_t +foo (svfloat32_t x, svfloat32_t y) +{ + svfloat32x2_t res = svundef2_f32 (); + res = svset2 (res, 0, x); + res = svset2 (res, 1, y); + return res; +}