From patchwork Thu Mar 11 07:52:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1450981 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=) 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 4Dx1Q02yzLz9sWY for ; Thu, 11 Mar 2021 18:52:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 26A463844062; Thu, 11 Mar 2021 07:52:33 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id 1517D385483E for ; Thu, 11 Mar 2021 07:52:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1517D385483E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oliva@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id CC46E117D1B; Thu, 11 Mar 2021 02:52:30 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dAkerrrpbE-l; Thu, 11 Mar 2021 02:52:30 -0500 (EST) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 57FD31171B3; Thu, 11 Mar 2021 02:52:30 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 12B7qIAu134996 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 11 Mar 2021 04:52:19 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: ipa-sra is mostly disabled by -mlongcall Organization: Free thinker, does not speak for AdaCore Date: Thu, 11 Mar 2021 04:52:18 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.3 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: , Cc: David Edelsohn , Segher Boessenkool Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Several ipa-sra tests fail because -mlongcall on powerpc is a TYPE_ATTRIBUTE, and those disable ipa-sra. This local workaround disables -mlongcall for the failing tests on powerpc*-*-vxworks*, so they get a chance to run even in kernel mode. (AdaCore has -mlongcall enabled for powerpc*-wrs-vxworks* kernel-mode targets.) This was regstrapped on x86_64-linux-gnu and ppc64-linux-gnu, and tested with a cross to a ppc64-vxworks7r2 with -mlongcall enabled by default. I was leaning towards maintaing this change internal, but I thought it wouldn't hurt to ask whether it's ok to install. I wonder whether it wouldn't be more desirable to have an alternate implementation of -mlongcall on ppc that didn't conflict with IPA-SRA, and IIRC with some scenarios involving C++ templates. E.g., on ARM, -mlong-calls doesn't add an attribute to every function, it just changes a default, that attributes short_call and long_call may then override for specific functions. Would a similar implementation be acceptable for ppc? for gcc/testsuite/ChangeLog * gcc.dg/ipa/ipa-sra-12.c: Add -mno-longcall on ppc*-vxworks*. * gcc.dg/ipa/ipa-sra-13.c: Likewise. * gcc.dg/ipa/ipa-sra-15.c: Likewise. * gcc.dg/ipa/ipa-sra-16.c: Likewise. * gcc.dg/ipa/ipa-sra-17.c: Likewise. * gcc.dg/ipa/ipa-sra-18.c: Likewise. --- gcc/testsuite/gcc.dg/ipa/ipa-sra-12.c | 1 + gcc/testsuite/gcc.dg/ipa/ipa-sra-13.c | 1 + gcc/testsuite/gcc.dg/ipa/ipa-sra-15.c | 1 + gcc/testsuite/gcc.dg/ipa/ipa-sra-16.c | 1 + gcc/testsuite/gcc.dg/ipa/ipa-sra-17.c | 1 + gcc/testsuite/gcc.dg/ipa/ipa-sra-18.c | 1 + 6 files changed, 6 insertions(+) diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-12.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-12.c index 0cc76bde319c7..0d74c8f52eee2 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-12.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-12.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ +/* { dg-additional-options "-mno-longcall" { target powerpc*-*-vxworks* } } */ /* Check of a simple and transitive structure split. */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-13.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-13.c index e8751dad67fcc..66083f040bad9 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-13.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-13.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ +/* { dg-additional-options "-mno-longcall" { target powerpc*-*-vxworks* } } */ /* Check of a by-reference structure split. */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-15.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-15.c index aa13a94c7c064..98b7ae5d4f11b 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-15.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-15.c @@ -1,5 +1,6 @@ /* { dg-do run } */ /* { dg-options "-O2 -fipa-sra -fdump-ipa-sra" } */ +/* { dg-additional-options "-mno-longcall" { target powerpc*-*-vxworks* } } */ /* Check of a recursive by-reference structure split. The recursive functions have to be pure right from the start, otherwise the current AA would detect diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-16.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-16.c index 2bffe297c7456..25f65fe1fc05a 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-16.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-16.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fipa-sra -fdump-ipa-sra -fdump-tree-optimized" } */ +/* { dg-additional-options "-mno-longcall" { target powerpc*-*-vxworks* } } */ /* Testing removal of unused parameters in recursive calls. */ diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-17.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-17.c index 9cb6367b37478..eaec0fcf90a91 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-17.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-17.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-sra -fdump-tree-optimized" } */ +/* { dg-additional-options "-mno-longcall" { target powerpc*-*-vxworks* } } */ #define DOIT #define DONT diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-sra-18.c b/gcc/testsuite/gcc.dg/ipa/ipa-sra-18.c index 3217b612231a2..1435ab228e3ae 100644 --- a/gcc/testsuite/gcc.dg/ipa/ipa-sra-18.c +++ b/gcc/testsuite/gcc.dg/ipa/ipa-sra-18.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-options "-O2 -fdump-ipa-sra" } */ +/* { dg-additional-options "-mno-longcall" { target powerpc*-*-vxworks* } } */ struct S {