From patchwork Tue Dec 22 21:56:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 1419501 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=adacore.com 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 4D0qtx0XxSz9sVk for ; Wed, 23 Dec 2020 08:57:10 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 47B7D3875414; Tue, 22 Dec 2020 21:57:08 +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 [IPv6:2620:20:4000:0:a9e:1ff:fe9b:1d1]) by sourceware.org (Postfix) with ESMTP id CA0C3387084D for ; Tue, 22 Dec 2020 21:57:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org CA0C3387084D 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 9FA9B117090; Tue, 22 Dec 2020 16:57:05 -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 r7dPE98L2hV9; Tue, 22 Dec 2020 16:57:05 -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 684D711703D; Tue, 22 Dec 2020 16:57:05 -0500 (EST) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 0BMLuxSW059388 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 22 Dec 2020 18:56:59 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: compile gcc.target/arm/{pr78255-2.c, memset-inline-2.c} with -mno-long-calls Organization: Free thinker, does not speak for AdaCore User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Date: Tue, 22 Dec 2020 18:56:59 -0300 Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-11.9 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: Joel Brobecker Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" If the target is configured such that -mlong-call is passed by default, the function calls these tests are trying to detect by scanning the assembly file are performed using long calls, like so: | foo: | @ memset-inline-2.c:12: memset (a, -1, 14); | mov r2, #14 @, | mvn r1, #0 @, | ldr r0, .L2 @, | ldr r3, .L2+4 @ tmp112, | bx r3 @ tmp112 Looking at .L2 (and in particular at .L2+4): | .L2: | .word a | .word memset <<<--- This change adds -mno-long-calls to the list of compiler options to make sure we generate short call code, allowing the assembly matching to pass. This is added unconditionally to the dg-options (as opposed to using dg-additional-options) because this test is already specific to ARM targets, and -mno-long-calls is available on all ARM targets. Regstrapped on x86_64-linux-gnu, and tested with -x-arm-wrs-vxworks7r2. Ok to install? from Joel Brobecker for gcc/testsuite/ChangeLog * gcc.target/arm/memset-inline-2.c: Add -mno-long-calls to the test's dg-options. * gcc.target/arm/pr78255-2.c: Likewise. --- gcc/testsuite/gcc.target/arm/memset-inline-2.c | 2 +- gcc/testsuite/gcc.target/arm/pr78255-2.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.target/arm/memset-inline-2.c b/gcc/testsuite/gcc.target/arm/memset-inline-2.c index b8195cab8a67c..ba1f7ed1f1e35 100644 --- a/gcc/testsuite/gcc.target/arm/memset-inline-2.c +++ b/gcc/testsuite/gcc.target/arm/memset-inline-2.c @@ -1,5 +1,5 @@ /* { dg-do run } */ -/* { dg-options "-save-temps -Os -fno-inline" } */ +/* { dg-options "-save-temps -Os -fno-inline -mno-long-calls" } */ #include #include diff --git a/gcc/testsuite/gcc.target/arm/pr78255-2.c b/gcc/testsuite/gcc.target/arm/pr78255-2.c index cc1c1801c37ee..fd379aecf9c75 100644 --- a/gcc/testsuite/gcc.target/arm/pr78255-2.c +++ b/gcc/testsuite/gcc.target/arm/pr78255-2.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2" } */ +/* { dg-options "-O2 -mno-long-calls" } */ extern int bar (void *);