From patchwork Fri Dec 9 19:45:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 130447 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 CC4F2B6F71 for ; Sat, 10 Dec 2011 06:46:05 +1100 (EST) Received: (qmail 31710 invoked by alias); 9 Dec 2011 19:46:04 -0000 Received: (qmail 31701 invoked by uid 22791); 9 Dec 2011 19:46:03 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Dec 2011 19:45:50 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pB9Jjo6q003072 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 9 Dec 2011 14:45:50 -0500 Received: from houston.quesejoda.com (vpn-8-8.rdu.redhat.com [10.11.8.8]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pB9Jjn37022181; Fri, 9 Dec 2011 14:45:49 -0500 Message-ID: <4EE2656C.4080801@redhat.com> Date: Fri, 09 Dec 2011 13:45:48 -0600 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Jakub Jelinek CC: Dominique Dhumieres , gcc-patches@gcc.gnu.org, developer@sandoe-acoustics.co.uk Subject: Re: PR/50076 make c-c++-common/cxxbitfields-3.c work in Darwin References: <20111209191704.6F9AC3BE1B@mailhost.lps.ens.fr> <20111209191929.GB1957@tyan-ft48-01.lab.bos.redhat.com> In-Reply-To: <20111209191929.GB1957@tyan-ft48-01.lab.bos.redhat.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 12/09/11 13:19, Jakub Jelinek wrote: > On Fri, Dec 09, 2011 at 08:17:04PM +0100, Dominique Dhumieres wrote: >>> +/* { dg-final { scan-assembler "movl.*, (_?var|\\(%)" } } */ >> >> It works for me too. > > Except that when matching just , (% it doesn't test almost anything. > IMNSHO you should instead just test it { target !fpic } or similar. > The _? in there is useful though. > > Jakub I assume you mean it tests almost anything, in which case I thought the source tiny enough to not elicit any more loads that could be matched. But the test is annoyingly system dependent. How about the patch below? I used nonpic instead of "!fpic", as check_effective_target_fpic tests whether -fpic/-fPIC is supported in the driver, which will obviously return true even if we're not generating PIC code. OTOH check_effective_target_nonpic tests whether we are generating PIC code by checking "#if __PIC__" which I believe is what we want. Does this work for everyone? * c-c++-common/cxxbitfields-3.c: Adjust regexp. Index: c-c++-common/cxxbitfields-3.c =================================================================== --- c-c++-common/cxxbitfields-3.c (revision 182028) +++ c-c++-common/cxxbitfields-3.c (working copy) @@ -18,4 +18,4 @@ void setit() var.j = 5; } -/* { dg-final { scan-assembler "movl.*, var" } } */ +/* { dg-final { scan-assembler "movl.*, _?var" { target nonpic } } } */