From patchwork Sun Jan 9 06:22:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sandra Loosemore X-Patchwork-Id: 49764 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1E01F386F440 for ; Sun, 9 Jan 2022 06:23:11 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 409643858401 for ; Sun, 9 Jan 2022 06:22:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 409643858401 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=mentor.com IronPort-SDR: UsLmMtOHQTppnzW7Q/hWvsFuB4c1kgJSQaRL+mfnk8akKHo+hKZk2+AtblS5v+/U4o3YCXHr+Z vY+QS9DvEKpSdTLnJHoLs6dE/tabKS99V8lFSSCXxxo3NoTwtDNs8L5Th+6OdM+mWBelvW+cuY 9yM1aOUG4nfSgBK1f8vxhvznLH74r/d+MFP0R6p/KOgHTn5Bnc8RJ1uHZDktZZopq7UwlDLv/N Or9yRn8LMflL6TLhxUGj4hoz99p9SjEbZY6F/lQVC43O9n5XeEOdCNtWiwpcYS/sxOKNHXER00 L2LBIfGbR586Fp+zTYS4NIGV X-IronPort-AV: E=Sophos;i="5.88,273,1635235200"; d="scan'208";a="70398019" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 08 Jan 2022 22:22:54 -0800 IronPort-SDR: q4lPraxATcv6UZQ96Xo47Fy/h3v4gvkpwb8jvR9206SBLVWxLG4LFqwwFE5vyl/09zQnXoQXwX aIO8woqPjFNNV5NORL8YFVJTHCawh8qPV2utw5zvFUqKEEwNJnkB94iSKFWwAAIHh9lhmMgUHS HrZECCH2d6rToPd70eFTqGoC9llWCgswLhucabYqxoCR18vhCtb5obvNRdhKzbRTkq7p47h/xC 3iOUI5dEFto+KTL9HEjKIBxd6AwrU1wCAF+EmzvmT9FgM7uQsFKAnqmxHLAUCo2gnLvfbQyT1r s4Y= To: "gcc-patches@gcc.gnu.org" From: Sandra Loosemore Subject: [COMIITTED] Testsuite: Make dependence on -fdelete-null-pointer-checks explicit Message-ID: <21d3892a-d5c8-3f35-7843-03f006676a88@codesourcery.com> Date: Sat, 8 Jan 2022 23:22:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 Content-Language: en-US X-ClientProxiedBy: svr-orw-mbx-10.mgc.mentorg.com (147.34.90.210) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) X-Spam-Status: No, score=-10.0 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" I've checked in these tweaks for various testcases that fail on nios2-elf without an explicit -fdelete-null-pointer-checks option. This target is configured to build with that optimization off by default. -Sandra commit 04c69d0e61c0f98a010d77a79ab749d5f0aa6b67 Author: Sandra Loosemore Date: Sat Jan 8 22:02:13 2022 -0800 Testsuite: Make dependence on -fdelete-null-pointer-checks explicit nios2-elf target defaults to -fno-delete-null-pointer-checks, breaking tests that implicitly depend on that optimization. Add the option explicitly on these tests. 2022-01-08 Sandra Loosemore gcc/testsuite/ * g++.dg/cpp0x/constexpr-compare1.C: Add explicit -fdelete-null-pointer-checks option. * g++.dg/cpp0x/constexpr-compare2.C: Likewise. * g++.dg/cpp0x/constexpr-typeid2.C: Likewise. * g++.dg/cpp1y/constexpr-94716.C: Likewise. * g++.dg/cpp1z/constexpr-compare1.C: Likewise. * g++.dg/cpp1z/constexpr-if36.C: Likewise. * gcc.dg/init-compare-1.c: Likewise. libstdc++-v3/ * testsuite/18_support/type_info/constexpr.cc: Add explicit -fdelete-null-pointer-checks option. diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-compare1.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-compare1.C index ad65019..603c6d5 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-compare1.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-compare1.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++11 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } extern int a, b; static_assert (&a == &a, ""); diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-compare2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-compare2.C index b1bc472..5c08dbb 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-compare2.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-compare2.C @@ -1,5 +1,6 @@ // PR c++/69681 // { dg-do compile { target c++11 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } void f(); void g(); diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid2.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid2.C index 78c6b8e..8ab76f9 100644 --- a/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid2.C +++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-typeid2.C @@ -1,5 +1,6 @@ // PR c++/103600 // { dg-do compile { target c++11 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } #include diff --git a/gcc/testsuite/g++.dg/cpp1y/constexpr-94716.C b/gcc/testsuite/g++.dg/cpp1y/constexpr-94716.C index 90173f3..5ac8720 100644 --- a/gcc/testsuite/g++.dg/cpp1y/constexpr-94716.C +++ b/gcc/testsuite/g++.dg/cpp1y/constexpr-94716.C @@ -1,5 +1,6 @@ // PR c++/94716 // { dg-do compile { target c++14 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } template char v = 0; static_assert (&v<2> == &v<2>, ""); diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-compare1.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-compare1.C index a53c03c..d40d536 100644 --- a/gcc/testsuite/g++.dg/cpp1z/constexpr-compare1.C +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-compare1.C @@ -1,4 +1,5 @@ // { dg-do compile { target c++17 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } inline int a = 0; inline int b = 0; diff --git a/gcc/testsuite/g++.dg/cpp1z/constexpr-if36.C b/gcc/testsuite/g++.dg/cpp1z/constexpr-if36.C index 4a1b134..e425af2 100644 --- a/gcc/testsuite/g++.dg/cpp1z/constexpr-if36.C +++ b/gcc/testsuite/g++.dg/cpp1z/constexpr-if36.C @@ -3,6 +3,7 @@ // weakness. // { dg-do compile { target c++17 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } extern void weakfn1 (void); extern void weakfn2 (void); diff --git a/gcc/testsuite/gcc.dg/init-compare-1.c b/gcc/testsuite/gcc.dg/init-compare-1.c index 9208b66..6737c85 100644 --- a/gcc/testsuite/gcc.dg/init-compare-1.c +++ b/gcc/testsuite/gcc.dg/init-compare-1.c @@ -1,4 +1,5 @@ /* { dg-do compile } */ +/* { dg-additional-options "-fdelete-null-pointer-checks" } */ extern int a, b; int c = &a == &a; diff --git a/libstdc++-v3/testsuite/18_support/type_info/constexpr.cc b/libstdc++-v3/testsuite/18_support/type_info/constexpr.cc index 07f4fb6..6fb67b4 100644 --- a/libstdc++-v3/testsuite/18_support/type_info/constexpr.cc +++ b/libstdc++-v3/testsuite/18_support/type_info/constexpr.cc @@ -1,5 +1,6 @@ // { dg-options "-std=gnu++23 -frtti" } // { dg-do compile { target c++23 } } +// { dg-additional-options "-fdelete-null-pointer-checks" } #include