From patchwork Tue Dec 7 14:18:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans-Peter Nilsson X-Patchwork-Id: 48587 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 1CDFF3858411 for ; Tue, 7 Dec 2021 14:20:11 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1CDFF3858411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1638886811; bh=jTJOLEBnM94fdZzkE+9KO4yE1ghFlytAjUQIhUae5o0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ce1fqJ1uoIrfQA4zZvIUrcqeIkPA9SPEl3QE6hXBzA/q5hNxf8KKBX82rCG/QsjTP 7x2owsWv6tOC+dMr6TCdBxQduqNoNuJNkzPl91k+U4M0qoJ3vHpWkeGu960HSN5tgb QAviHMc/OtxZy/ZDO6nHH5bTPEbbNfi8hyFgAtCs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by sourceware.org (Postfix) with ESMTPS id 1A1BE3858435 for ; Tue, 7 Dec 2021 14:18:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1A1BE3858435 To: Subject: [PATCH] testsuite: Use attribute "noipa" in sibcall tests MIME-Version: 1.0 Message-ID: <20211207141847.3E9C2203B3@pchp3.se.axis.com> Date: Tue, 7 Dec 2021 15:18:47 +0100 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, 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: , X-Patchwork-Original-From: Hans-Peter Nilsson via Gcc-patches From: Hans-Peter Nilsson Reply-To: Hans-Peter Nilsson Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" ...instead of attribute "noinline". For cris-elf, testsuite/gcc.dg/sibcall-3.c and sibcall-4.c "XPASS", without sibcalls being implemented. On inspection, recurser_void2 is set to be an assembly-level alias for recurser_void1 as in ".set _recurser_void2,_recurser_void1" for both these cases. IOW, those "__attribute__((noinline))" should be "__attribute__((noipa))". The astute reader will notice that I also adjust test-cases where self-recursion should occur: as mentioned in sibcall-1.c "self-recursion tail calls are optimized for all targets, regardless of presence of sibcall patterns". But, that optimization happens even with "noipa", as observed by the test-cases still passing for cris-elf after patching. Being of a small mind, I like consistency, but not all the time, so there's hope. Now, editing test-cases is usually frowned upon, but I have it from authoritative sources that the intent was as patched. Ok to commit? testsuite: * gcc.dg/sibcall-1.c, gcc.dg/sibcall-10.c, gcc.dg/sibcall-2.c, gcc.dg/sibcall-3.c, gcc.dg/sibcall-4.c, gcc.dg/sibcall-9.c: Replace attribute "noinline" with "noipa". Change-Id: I001030b314883170e6ff7d77e38ed0c7b57fecec --- gcc/testsuite/gcc.dg/sibcall-1.c | 2 +- gcc/testsuite/gcc.dg/sibcall-10.c | 6 +++--- gcc/testsuite/gcc.dg/sibcall-2.c | 2 +- gcc/testsuite/gcc.dg/sibcall-3.c | 6 +++--- gcc/testsuite/gcc.dg/sibcall-4.c | 6 +++--- gcc/testsuite/gcc.dg/sibcall-9.c | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gcc/testsuite/gcc.dg/sibcall-1.c b/gcc/testsuite/gcc.dg/sibcall-1.c index 367ee4374e16..f2bd3ade2176 100644 --- a/gcc/testsuite/gcc.dg/sibcall-1.c +++ b/gcc/testsuite/gcc.dg/sibcall-1.c @@ -47,7 +47,7 @@ recurser_void (int n) void *trackpoint; -void __attribute__ ((noinline)) +void __attribute__ ((noipa)) track (int n) { char stackpos[1]; diff --git a/gcc/testsuite/gcc.dg/sibcall-10.c b/gcc/testsuite/gcc.dg/sibcall-10.c index d6668dc748da..f692869a99e6 100644 --- a/gcc/testsuite/gcc.dg/sibcall-10.c +++ b/gcc/testsuite/gcc.dg/sibcall-10.c @@ -46,7 +46,7 @@ int main () reasonably sure is to make them have the same contents (regarding the n tests). */ -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void1 (void) { if (n == 0 || n == 7 || n == 8) @@ -58,7 +58,7 @@ recurser_void1 (void) recurser_void2 (); } -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void2 (void) { if (n == 0 || n == 7 || n == 8) @@ -73,7 +73,7 @@ recurser_void2 (void) void *trackpoint; -void __attribute__ ((noinline)) +void __attribute__ ((noipa)) track () { char stackpos[1]; diff --git a/gcc/testsuite/gcc.dg/sibcall-2.c b/gcc/testsuite/gcc.dg/sibcall-2.c index a626273e6200..0d4df82b0ca4 100644 --- a/gcc/testsuite/gcc.dg/sibcall-2.c +++ b/gcc/testsuite/gcc.dg/sibcall-2.c @@ -38,7 +38,7 @@ recurser_void (void) void *trackpoint; -void __attribute__ ((noinline)) +void __attribute__ ((noipa)) track () { char stackpos[1]; diff --git a/gcc/testsuite/gcc.dg/sibcall-3.c b/gcc/testsuite/gcc.dg/sibcall-3.c index 77227824827a..8f6e776937a8 100644 --- a/gcc/testsuite/gcc.dg/sibcall-3.c +++ b/gcc/testsuite/gcc.dg/sibcall-3.c @@ -40,7 +40,7 @@ int main () reasonably sure is to make them have the same contents (regarding the n tests). */ -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void1 (int n) { if (n == 0 || n == 7 || n == 8) @@ -52,7 +52,7 @@ recurser_void1 (int n) recurser_void2 (n + 1); } -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void2 (int n) { if (n == 0 || n == 7 || n == 8) @@ -66,7 +66,7 @@ recurser_void2 (int n) void *trackpoint; -void __attribute__ ((noinline)) +void __attribute__ ((noipa)) track (int n) { char stackpos[1]; diff --git a/gcc/testsuite/gcc.dg/sibcall-4.c b/gcc/testsuite/gcc.dg/sibcall-4.c index 7fa51cab0dcb..a587c7254959 100644 --- a/gcc/testsuite/gcc.dg/sibcall-4.c +++ b/gcc/testsuite/gcc.dg/sibcall-4.c @@ -41,7 +41,7 @@ int main () reasonably sure is to make them have the same contents (regarding the n tests). */ -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void1 (void) { if (n == 0 || n == 7 || n == 8) @@ -53,7 +53,7 @@ recurser_void1 (void) recurser_void2 (); } -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void2 (void) { if (n == 0 || n == 7 || n == 8) @@ -67,7 +67,7 @@ recurser_void2 (void) void *trackpoint; -void __attribute__ ((noinline)) +void __attribute__ ((noipa)) track () { char stackpos[1]; diff --git a/gcc/testsuite/gcc.dg/sibcall-9.c b/gcc/testsuite/gcc.dg/sibcall-9.c index 0bf8f38ee5ce..40262c7a7e14 100644 --- a/gcc/testsuite/gcc.dg/sibcall-9.c +++ b/gcc/testsuite/gcc.dg/sibcall-9.c @@ -45,7 +45,7 @@ int main () reasonably sure is to make them have the same contents (regarding the n tests). */ -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void1 (int n) { if (n == 0 || n == 7 || n == 8) @@ -57,7 +57,7 @@ recurser_void1 (int n) recurser_void2 (n + 1); } -static void __attribute__((noinline)) ATTR +static void __attribute__((noipa)) ATTR recurser_void2 (int n) { if (n == 0 || n == 7 || n == 8) @@ -72,7 +72,7 @@ recurser_void2 (int n) void *trackpoint; -void __attribute__ ((noinline)) +void __attribute__ ((noipa)) track (int n) { char stackpos[1];