From patchwork Fri Jun 24 10:29:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom de Vries X-Patchwork-Id: 101768 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]) by ozlabs.org (Postfix) with SMTP id E06D0B6F81 for ; Fri, 24 Jun 2011 20:30:10 +1000 (EST) Received: (qmail 3494 invoked by alias); 24 Jun 2011 10:30:08 -0000 Received: (qmail 3403 invoked by uid 22791); 24 Jun 2011 10:30:05 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_FAIL, TW_IW, TW_MX X-Spam-Check-By: sourceware.org Received: from smtp-vbr18.xs4all.nl (HELO smtp-vbr18.xs4all.nl) (194.109.24.38) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 24 Jun 2011 10:29:49 +0000 Received: from [192.168.1.68] (teejay.xs4all.nl [213.84.119.160]) (authenticated bits=0) by smtp-vbr18.xs4all.nl (8.13.8/8.13.8) with ESMTP id p5OATiiK035974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 24 Jun 2011 12:29:45 +0200 (CEST) (envelope-from vries@codesourcery.com) Message-ID: <4E046701.4090306@codesourcery.com> Date: Fri, 24 Jun 2011 12:29:21 +0200 From: Tom de Vries User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2 Thunderbird/3.1.10 MIME-Version: 1.0 To: Janis Johnson CC: Ramana Radhakrishnan , "gcc-patches@gcc.gnu.org" Subject: Re: [testsuite] ARM ivopts tests: skip for no thumb support References: <4E03B1D1.8090604@codesourcery.com> <4E03B914.1070708@codesourcery.com> In-Reply-To: <4E03B914.1070708@codesourcery.com> 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 On 06/24/2011 12:07 AM, Janis Johnson wrote: > On 06/23/2011 02:56 PM, Ramana Radhakrishnan wrote: >> On 23 June 2011 22:36, Janis Johnson wrote: >>> Tests gcc.target/arm/ivopts*.c add -mthumb but fail on targets without >>> thumb support; skip those targets. The tests save temporary files and >>> need to remove them at the end, easily done with cleanup-saved-temps. >>> >>> Test ivopts-6.c is the only one of the set that does not require thumb2 >>> support in the check for object-size, and it fails for -march=iwmmxt >>> and iwmmxt2; the check should probably be used on that test as well, >>> although I haven't included it here. >> >> I'm not sure I understand the change for ivopts-6.c : >> >> It's skipping if there is no Thumb support by default but the test >> assumes the test will run with -marm on the command line ? >> >> Ramana > > Oops, I got carried away and didn't notice that it uses -marm rather > than -mthumb. I'll take another look at that one. > > Janis How about this patch? I removed all -mthumb/-marm option settings, and instead focused on trying to guard the object-size tests properly. I introduced 2 new arm-related effective targets to accomplish this. - arm_thumb2: Tests if we're compiling for thumb2. - arm_nothumb: Tests if we're not compiling for any thumb. I don't know how to get the same effect with the existing arm-related effective targets. Thanks, - Tom 2011-06-24 Janis Johnson Tom de Vries * lib/target-supports.exp (check_effective_target_arm_nothumb) (check_effective_target_arm_thumb2): New effective targets. * gcc.target/arm/ivopts.c: Remove -mthumb/-marm. Guard object-size properly. Clean up temporary files. * gcc.target/arm/ivopts-2.c: Likewise. * gcc.target/arm/ivopts-3.c: Likewise. * gcc.target/arm/ivopts-4.c: Likewise. * gcc.target/arm/ivopts-5.c: Likewise. * gcc.target/arm/ivopts-6.c: Remove duplicate of ivopts.c. diff -u gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts-3.c (revision 0) @@ -1,5 +1,5 @@ /* { dg-do assemble } */ -/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */ +/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */ extern unsigned int foo2 (short*) __attribute__((pure)); @@ -19,2 +19,3 @@ -/* { dg-final { object-size text <= 30 { target arm_thumb2_ok } } } */ +/* { dg-final { object-size text <= 30 { target arm_thumb2 } } } */ /* { dg-final { cleanup-tree-dump "ivopts" } } */ +/* { dg-final { cleanup-saved-temps "ivopts" } } */ diff -u gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts-4.c (revision 0) @@ -1,5 +1,5 @@ /* { dg-do assemble } */ -/* { dg-options "-mthumb -Os -fdump-tree-ivopts -save-temps" } */ +/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */ extern unsigned int foo (int*) __attribute__((pure)); @@ -20,2 +20,3 @@ -/* { dg-final { object-size text <= 36 { target arm_thumb2_ok } } } */ +/* { dg-final { object-size text <= 36 { target arm_thumb2 } } } */ /* { dg-final { cleanup-tree-dump "ivopts" } } */ +/* { dg-final { cleanup-saved-temps "ivopts" } } */ diff -u gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts-5.c (revision 0) @@ -1,5 +1,5 @@ /* { dg-do assemble } */ -/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */ +/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */ extern unsigned int foo (int*) __attribute__((pure)); @@ -19,2 +19,3 @@ -/* { dg-final { object-size text <= 30 { target arm_thumb2_ok } } } */ +/* { dg-final { object-size text <= 30 { target arm_thumb2 } } } */ /* { dg-final { cleanup-tree-dump "ivopts" } } */ +/* { dg-final { cleanup-saved-temps "ivopts" } } */ diff -u gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts-2.c (revision 0) @@ -1,5 +1,5 @@ /* { dg-do assemble } */ -/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */ +/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */ extern void foo2 (short*); @@ -17,2 +17,3 @@ -/* { dg-final { object-size text <= 26 { target arm_thumb2_ok } } } */ +/* { dg-final { object-size text <= 26 { target arm_thumb2 } } } */ /* { dg-final { cleanup-tree-dump "ivopts" } } */ +/* { dg-final { cleanup-saved-temps "ivopts" } } */ diff -u gcc/testsuite/gcc.target/arm/ivopts.c (revision 0) gcc/testsuite/gcc.target/arm/ivopts.c (revision 0) --- gcc/testsuite/gcc.target/arm/ivopts.c (revision 0) +++ gcc/testsuite/gcc.target/arm/ivopts.c (revision 0) @@ -1,5 +1,5 @@ /* { dg-do assemble } */ -/* { dg-options "-Os -mthumb -fdump-tree-ivopts -save-temps" } */ +/* { dg-options "-Os -fdump-tree-ivopts -save-temps" } */ void tr5 (short array[], int n) @@ -14,2 +14,5 @@ -/* { dg-final { object-size text <= 20 { target arm_thumb2_ok } } } */ +/* { dg-final { object-size text <= 20 { target arm_thumb2 } } } */ +/* { dg-final { object-size text <= 32 { target { arm_nothumb && { ! arm_iwmmxt_ok } } } } } */ +/* { dg-final { object-size text <= 36 { target { arm_nothumb && arm_iwmmxt_ok } } } } */ /* { dg-final { cleanup-tree-dump "ivopts" } } */ +/* { dg-final { cleanup-saved-temps "ivopts" } } */ reverted: --- gcc/testsuite/gcc.target/arm/ivopts-6.c (revision 0) +++ /dev/null (new file) @@ -1,15 +0,0 @@ -/* { dg-do assemble } */ -/* { dg-options "-Os -fdump-tree-ivopts -save-temps -marm" } */ - -void -tr5 (short array[], int n) -{ - int x; - if (n > 0) - for (x = 0; x < n; x++) - array[x] = 0; -} - -/* { dg-final { scan-tree-dump-times "PHI <" 1 "ivopts"} } */ -/* { dg-final { object-size text <= 32 } } */ -/* { dg-final { cleanup-tree-dump "ivopts" } } */ only in patch2: unchanged: --- gcc/testsuite/lib/target-supports.exp (revision 173734) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -1849,6 +1849,15 @@ proc check_effective_target_arm32 { } { }] } +# Return 1 is this is an arm target not using Thumb +proc check_effective_target_arm_nothumb { } { + return [check_no_compiler_messages arm_nothumb assembly { + #if (defined(__thumb__) || defined(__thumb2__)) + #error FOO + #endif + }] +} + # Return 1 if this is an ARM target that only supports aligned vector accesses proc check_effective_target_arm_vect_no_misalign { } { return [check_no_compiler_messages arm_vect_no_misalign assembly { @@ -1994,6 +2003,16 @@ proc check_effective_target_arm_thumb2_o } "-mthumb"] } +# Return 1 is this is an ARM target where is Thumb-2 used. + +proc check_effective_target_arm_thumb2 { } { + return [check_no_compiler_messages arm_thumb2 assembly { + #if !defined(__thumb2__) + #error FOO + #endif + } ""] +} + # Return 1 if the target supports executing NEON instructions, 0 # otherwise. Cache the result.