From patchwork Fri Dec 9 19:45:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: PR/50076 make c-c++-common/cxxbitfields-3.c work in Darwin X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 130447 Message-Id: <4EE2656C.4080801@redhat.com> To: Jakub Jelinek Cc: Dominique Dhumieres , gcc-patches@gcc.gnu.org, developer@sandoe-acoustics.co.uk Date: Fri, 09 Dec 2011 13:45:48 -0600 From: Aldy Hernandez List-Id: 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 } } } */