From patchwork Wed Jul 9 15:53:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 368253 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6E640140116 for ; Thu, 10 Jul 2014 01:53:52 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; q=dns; s=default; b=XHlj4KAs7OFgF440mvq5rf9a/RQYkQlj63Rl1kyM+WV O2NIiCRZCIBM47uKyJTorNJkcvyTEADBlDH6yv26/XGYrfcsuRpSSDfOkBQBjoE6 I6PMY2Y5U+NB2i5bkYe1NBjFf2OYoQQl7mi/QU1czFqtHgt+mT5pIQ+smeRc8d1g = DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:content-type; s=default; bh=8BNVwnpCEb6UcKXjy0RMw9kD74s=; b=f/uvLwSMdvTWhJUf5 ZJ2c0l/5watrwc7CXa4wKb4h2YMiYH4uW0BTxJPj8dcZbPTIUhmnDq6kUtLDrm2R vnnL10dzedWWGKZTVd4cDZO5gwQyeJkXAPM1g8DopeFM77mGic2Li+kCXllw96X1 i1+/Qe3mef764SPW6Gdg98WWmI= Received: (qmail 19155 invoked by alias); 9 Jul 2014 15:53:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 18997 invoked by uid 89); 9 Jul 2014 15:53:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 Jul 2014 15:53:37 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1X4uBZ-0005ON-0N from Tom_deVries@mentor.com ; Wed, 09 Jul 2014 08:53:33 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Wed, 9 Jul 2014 08:53:32 -0700 Received: from [127.0.0.1] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.2.247.3; Wed, 9 Jul 2014 16:53:30 +0100 Message-ID: <53BD6578.4010200@mentor.com> Date: Wed, 9 Jul 2014 17:53:28 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Richard Sandiford CC: GCC Patches Subject: Simplify gcc.target/mips/fuse-caller-save*.c Richard, during testing the gcc.target/mips/fuse-caller-save*.c test-cases with more combinations of -march, -mabi, -fpic etc, I found that the checks for amount of stores are rather fragile, so I removed them in this patch. The remaining checks check for absence of $16. To address the risk that $16 is absent for another reason than -fuse-caller-save, I've added 3 corresponding test-cases that check for presence of $16 with -fno-use-caller-save. The fuse-caller-save tests now pass for all combinations I've tried. OK for trunk? Thanks, - Tom 2014-07-09 Tom de Vries * gcc.target/mips/fuse-caller-save.c: Remove test on number of stores. * gcc.target/mips/fuse-caller-save-mips16.c: Same. * gcc.target/mips/fuse-caller-save-micromips.c: Same. * gcc.target/mips/fuse-caller-save-neg.c: New test. * gcc.target/mips/fuse-caller-save-mips16-neg.c: Same. * gcc.target/mips/fuse-caller-save-micromips-neg.c: Same. diff --git a/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips-neg.c b/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips-neg.c new file mode 100644 index 0000000..9d43be9 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips-neg.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-use-caller-save (-mmicromips)" } */ +/* At -O0 and -O1, the register allocator behaves more conservatively, and + the fuse-caller-save optimization doesnt' trigger. */ +/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" } } */ +/* Testing -fuse-caller-save optimization option. */ + +#define ATTRIBUTE MICROMIPS +#include "fuse-caller-save.h" + +/* Check that the first caller-save register is used. This is to make sure that + test fuse-caller-save-mips16 tests something meaningful. */ +/* { dg-final { scan-assembler "\\\$16" } } */ diff --git a/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips.c b/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips.c index 6ad01c7..bb70890 100644 --- a/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips.c +++ b/gcc/testsuite/gcc.target/mips/fuse-caller-save-micromips.c @@ -8,10 +8,5 @@ #define ATTRIBUTE MICROMIPS #include "fuse-caller-save.h" -/* Check that there are only 2 stack-saves: r31 in main and foo. */ - -/* Check that there only 2 sw/sd. */ -/* { dg-final { scan-assembler-times "(?n)s\[wd\]\t\\\$.*,.*\\(\\\$sp\\)" 2 } } */ - /* Check that the first caller-save register is unused. */ /* { dg-final { scan-assembler-not "\\\$16" } } */ diff --git a/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16-neg.c b/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16-neg.c new file mode 100644 index 0000000..cb6360b --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16-neg.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-use-caller-save (-mips16)" } */ +/* At -O0 and -O1, the register allocator behaves more conservatively, and + the fuse-caller-save optimization doesnt' trigger. */ +/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" } } */ +/* Testing -fuse-caller-save optimization option. */ + +#define ATTRIBUTE MIPS16 +#include "fuse-caller-save.h" + +/* Check that the first caller-save register is used. This is to make sure that + test fuse-caller-save-mips16 tests something meaningful. */ +/* { dg-final { scan-assembler "\\\$16" } } */ diff --git a/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16.c b/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16.c index a7c6cf4..62b33a7 100644 --- a/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16.c +++ b/gcc/testsuite/gcc.target/mips/fuse-caller-save-mips16.c @@ -8,10 +8,5 @@ #define ATTRIBUTE MIPS16 #include "fuse-caller-save.h" -/* Check that there are only 2 stack-saves: r31 in main and foo. */ - -/* Check that there only 2 sw/sd. */ -/* { dg-final { scan-assembler-times "(?n)s\[wd\]\t\\\$.*,.*\\(\\\$sp\\)" 2 } } */ - /* Check that the first caller-save register is unused. */ /* { dg-final { scan-assembler-not "\\\$16" } } */ diff --git a/gcc/testsuite/gcc.target/mips/fuse-caller-save-neg.c b/gcc/testsuite/gcc.target/mips/fuse-caller-save-neg.c new file mode 100644 index 0000000..3de0168 --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/fuse-caller-save-neg.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ +/* { dg-options "-fno-use-caller-save" } */ +/* At -O0 and -O1, the register allocator behaves more conservatively, and + the fuse-caller-save optimization doesnt' trigger. */ +/* { dg-skip-if "" { *-*-* } { "-O0" "-O1" } } */ +/* Testing -fuse-caller-save optimization option. */ + +#define ATTRIBUTE NOCOMPRESSION +#include "fuse-caller-save.h" + +/* Check that the first caller-save register is used. This is to make sure that + test fuse-caller-save-mips16 tests something meaningful. */ +/* { dg-final { scan-assembler "\\\$16" } } */ diff --git a/gcc/testsuite/gcc.target/mips/fuse-caller-save.c b/gcc/testsuite/gcc.target/mips/fuse-caller-save.c index 72c08fe..a0267f0 100644 --- a/gcc/testsuite/gcc.target/mips/fuse-caller-save.c +++ b/gcc/testsuite/gcc.target/mips/fuse-caller-save.c @@ -10,8 +10,5 @@ /* Check that there are only 2 stack-saves: r31 in main and foo. */ -/* Check that there only 2 sw/sd. */ -/* { dg-final { scan-assembler-times "(?n)s\[wd\]\t\\\$.*,.*\\(\\\$sp\\)" 2 } } */ - /* Check that the first caller-save register is unused. */ /* { dg-final { scan-assembler-not "\\\$16" } } */ -- 1.9.1