diff mbox

PR debug/42487, xfail scan-assembler on DW_AT_ranges in gcc.dg/debug/dwarf2/aranges-fnsec-1.c for darwin

Message ID 20100816233214.GA16983@bromo.med.uc.edu
State New
Headers show

Commit Message

Jack Howarth Aug. 16, 2010, 11:32 p.m. UTC
The scan-assembler on "DW_AT_ranges" in gcc.dg/debug/dwarf2/aranges-fnsec-1.c
should be xfail'd on darwin since that target doesn't support -ffunction-sections.
Tested on x86_64-apple-darwin10. Okay for gcc trunk and 4.5.2?
                 Jack

2010-08-16  Jack Howarth <howarth@bromo.med.uc.edu>

	PR debug/42487
	* gcc.dg/debug/dwarf2/aranges-fnsec-1.c (scan-assembler "DW_AT_ranges"): xfail *-*-darwin*.

Comments

Richard Henderson Aug. 16, 2010, 11:34 p.m. UTC | #1
On 08/16/2010 04:32 PM, Jack Howarth wrote:
> Index: gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c
> ===================================================================
> --- gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c	(revision 163286)
> +++ gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c	(working copy)
> @@ -5,7 +5,7 @@
>  /* { dg-options "-gdwarf-2 -ffunction-sections -w -dA" } */
>  /* { dg-final { scan-assembler-not "\\.Letext0-\\.Ltext0" } } */
>  /* { dg-final { scan-assembler-not "\\.Ltext0\[^\n\r\]*Offset 0x0" } } */
> -/* { dg-final { scan-assembler "DW_AT_ranges" } } */
> +/* { dg-final { scan-assembler "DW_AT_ranges" { xfail *-*-darwin* } } } */

You should use a dg-skip-if.  The other two tests *should* be failing,
but don't because the regexp's incorrectly use a "." unconditionally.


r~
Mark Mitchell Aug. 17, 2010, 3:08 p.m. UTC | #2
Richard Henderson wrote:
>> +/* { dg-final { scan-assembler "DW_AT_ranges" { xfail *-*-darwin* } } } */
> 
> You should use a dg-skip-if.  The other two tests *should* be failing,
> but don't because the regexp's incorrectly use a "." unconditionally.

And we shouldn't be adding more xfail's for specific operating systems,
unless absolutely necessary.  If the issue here is that we don't have
-function-sections, then presumably the test will fail on all targets
with that characteristic, and we should use the "effective target"
machinery to guard the test.
Jack Howarth Aug. 17, 2010, 3:16 p.m. UTC | #3
On Tue, Aug 17, 2010 at 08:08:05AM -0700, Mark Mitchell wrote:
> Richard Henderson wrote:
> >> +/* { dg-final { scan-assembler "DW_AT_ranges" { xfail *-*-darwin* } } } */
> > 
> > You should use a dg-skip-if.  The other two tests *should* be failing,
> > but don't because the regexp's incorrectly use a "." unconditionally.
> 
> And we shouldn't be adding more xfail's for specific operating systems,
> unless absolutely necessary.  If the issue here is that we don't have
> -function-sections, then presumably the test will fail on all targets
> with that characteristic, and we should use the "effective target"
> machinery to guard the test.

Richard,
   This patch has been superseded by http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01218.html
based on Richard Henderson's comments. Can you review that one instead?
               Jack

> 
> -- 
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
Mark Mitchell Aug. 17, 2010, 3:24 p.m. UTC | #4
Jack Howarth wrote:

>> And we shouldn't be adding more xfail's for specific operating systems,

>    This patch has been superseded by http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01218.html
> based on Richard Henderson's comments. Can you review that one instead?

The same issue applies to the revised patch.
Richard Henderson Aug. 17, 2010, 3:26 p.m. UTC | #5
On 08/17/2010 08:16 AM, Jack Howarth wrote:
> On Tue, Aug 17, 2010 at 08:08:05AM -0700, Mark Mitchell wrote:
>> Richard Henderson wrote:
>>>> +/* { dg-final { scan-assembler "DW_AT_ranges" { xfail *-*-darwin* } } } */
>>>
>>> You should use a dg-skip-if.  The other two tests *should* be failing,
>>> but don't because the regexp's incorrectly use a "." unconditionally.
>>
>> And we shouldn't be adding more xfail's for specific operating systems,
>> unless absolutely necessary.  If the issue here is that we don't have
>> -function-sections, then presumably the test will fail on all targets
>> with that characteristic, and we should use the "effective target"
>> machinery to guard the test.
> 
> Richard,
>    This patch has been superseded by http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01218.html
> based on Richard Henderson's comments. Can you review that one instead?

Well, that new patch is what I asked for, but Mark is asking for
something more.  In gcc/testsuite/lib/target-supports-dg.exp, add
a proc dg-require-function-sections, then add a line

  { dg-require function-sections }

to the testcase.

I'm not sure how to test for function sections for Darwin.  
Ordinarily I would think you would look for an error message from
the compiler, but for some reason Darwin doesn't generate one 
and yet still fails to actually use function sections.

Probably what you'll want to do is match the target_triplet in
there.  See dg-require-dll.


r~
Mark Mitchell Aug. 17, 2010, 3:31 p.m. UTC | #6
Richard Henderson wrote:

> Probably what you'll want to do is match the target_triplet in
> there.  See dg-require-dll.

Yes, I think that's fine.  The important thing is that the testsuite is
testing features, not triplets.  If the features themselves are
implemented using triplets, that's pretty manageable.
Iain Sandoe Aug. 17, 2010, 3:38 p.m. UTC | #7
On 17 Aug 2010, at 16:26, Richard Henderson wrote:
>
> I'm not sure how to test for function sections for Darwin.
> Ordinarily I would think you would look for an error message from
> the compiler, but for some reason Darwin doesn't generate one
> and yet still fails to actually use function sections.

I guess that, because the darwin equivalent (.subsections_via_symbols)  
defaults 'on' for us, someone must have decided that an error message  
would be unproductive.

As you say, one is going to end up checking the target triplet anyway  
in this case.

cheers
Iain
Jack Howarth Aug. 17, 2010, 3:48 p.m. UTC | #8
On Tue, Aug 17, 2010 at 08:26:55AM -0700, Richard Henderson wrote:
> On 08/17/2010 08:16 AM, Jack Howarth wrote:
> > On Tue, Aug 17, 2010 at 08:08:05AM -0700, Mark Mitchell wrote:
> >> Richard Henderson wrote:
> >>>> +/* { dg-final { scan-assembler "DW_AT_ranges" { xfail *-*-darwin* } } } */
> >>>
> >>> You should use a dg-skip-if.  The other two tests *should* be failing,
> >>> but don't because the regexp's incorrectly use a "." unconditionally.
> >>
> >> And we shouldn't be adding more xfail's for specific operating systems,
> >> unless absolutely necessary.  If the issue here is that we don't have
> >> -function-sections, then presumably the test will fail on all targets
> >> with that characteristic, and we should use the "effective target"
> >> machinery to guard the test.
> > 
> > Richard,
> >    This patch has been superseded by http://gcc.gnu.org/ml/gcc-patches/2010-08/msg01218.html
> > based on Richard Henderson's comments. Can you review that one instead?
> 
> Well, that new patch is what I asked for, but Mark is asking for
> something more.  In gcc/testsuite/lib/target-supports-dg.exp, add
> a proc dg-require-function-sections, then add a line
> 
>   { dg-require function-sections }
> 
> to the testcase.
> 
> I'm not sure how to test for function sections for Darwin.  
> Ordinarily I would think you would look for an error message from
> the compiler, but for some reason Darwin doesn't generate one 
> and yet still fails to actually use function sections.
> 
> Probably what you'll want to do is match the target_triplet in
> there.  See dg-require-dll.

Richard,
   Aren't the targets which don't support function sections also
those that set TARGET_ASM_FUNCTION_RODATA_SECTION to default_no_function_rodata_section?

2004-08-12  Jakub Jelinek  <jakub@redhat.com>

        PR c++/16276
        * output.h (default_function_rodata_section,
        default_no_function_rodata_section): New prototypes.
        * target.h (struct gcc_target): Add asm_out.function_rodata_section.
        * target-def.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
        (TARGET_ASM_OUT): Add it.
        * varasm.c (default_function_rodata_section,
        default_no_function_rodata_section): New functions.
        * final.c (final_scan_insn): Call
        targetm.asm_out.function_rodata_section instead of
        readonly_data_section.
        * config/darwin.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Define.
        * config/mcore/mcore.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
        * config/ip2k/ip2k.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
        * config/rs6000/xcoff.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
        Likewise.
        * config/alpha/alpha.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
        * config/i386/cygming.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
        Likewise.
        * config/i386/i386-interix.h (TARGET_ASM_FUNCTION_RODATA_SECTION):
        Likewise.
        * config/arm/pe.h (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
        * config/avr/avr.c (TARGET_ASM_FUNCTION_RODATA_SECTION): Likewise.
        * doc/tm.texi (TARGET_ASM_FUNCTION_RODATA_SECTION): Document.

Also, I noticed that we are currently passing some of the other -function-sections tests
on darwin...

g++.dg/eh/gcsec1.C
gcc.dg/asm-fs-1.c
gcc.dg/special/gcsec-1.c
gcc.dg/ucnid-12.c

These currently are using dg-skip-if on some targets already (but not darwin).
        Jack
> 
> 
> r~
Richard Henderson Aug. 17, 2010, 3:58 p.m. UTC | #9
On 08/17/2010 08:48 AM, Jack Howarth wrote:
>    Aren't the targets which don't support function sections also
> those that set TARGET_ASM_FUNCTION_RODATA_SECTION to default_no_function_rodata_section?

They should be the ones for which targetm.have_named_sections
is false.  Er, which is now universally true, says grep.  We
don't support any a.out targets anymore?

I really have no idea, apparently.

> Also, I noticed that we are currently passing some of the other -function-sections tests
> on darwin...

Iain explained this one -- .subsections_via_symbols allows many
of the -function-sections type tests to succeed.  So, I'm really
not sure how to proceed.  Mark?


r~
Jack Howarth Aug. 17, 2010, 4:15 p.m. UTC | #10
On Tue, Aug 17, 2010 at 08:58:04AM -0700, Richard Henderson wrote:
> On 08/17/2010 08:48 AM, Jack Howarth wrote:
> >    Aren't the targets which don't support function sections also
> > those that set TARGET_ASM_FUNCTION_RODATA_SECTION to default_no_function_rodata_section?
> 
> They should be the ones for which targetm.have_named_sections
> is false.  Er, which is now universally true, says grep.  We
> don't support any a.out targets anymore?
> 
> I really have no idea, apparently.
> 
> > Also, I noticed that we are currently passing some of the other -function-sections tests
> > on darwin...
> 
> Iain explained this one -- .subsections_via_symbols allows many
> of the -function-sections type tests to succeed.  So, I'm really
> not sure how to proceed.  Mark?

Richard
   I wonder if this means that some of those dg-skip-if in the other
testcases passing -ffunction-sections are just stale entries from
the depreciated a.out support? Does anyone know if rs6000-*-aix*,
powerpc*-*-aix* and hppa*-*-hpux* currently support function sections?
Also it is strange that rs6000-*-aix* and powerpc*-*-aix* skip
g++.dg/eh/gcsec1.C and gcc.dg/special/gcsec-1.c but hppa*-*-hpux*
skips gcc.dg/ucnid-12.c. Not really coherent.
         Jack

> 
> 
> r~
Richard Henderson Aug. 17, 2010, 4:19 p.m. UTC | #11
On 08/17/2010 09:15 AM, Jack Howarth wrote:
\>    I wonder if this means that some of those dg-skip-if in the other
> testcases passing -ffunction-sections are just stale entries from
> the depreciated a.out support? Does anyone know if rs6000-*-aix*,
> powerpc*-*-aix* and hppa*-*-hpux* currently support function sections?
> Also it is strange that rs6000-*-aix* and powerpc*-*-aix* skip
> g++.dg/eh/gcsec1.C and gcc.dg/special/gcsec-1.c but hppa*-*-hpux*
> skips gcc.dg/ucnid-12.c. Not really coherent.

Well, the gcsec tests also require linker support for --gc-sections,
which the system linker for AIX obviously does not.  I am surprised
that they wouldn't be marked for hpux; perhaps the only people that
care about hpux are using binutils on that target?

I can't imagine what's different about ucnid-12 for hpux.


r~
diff mbox

Patch

Index: gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c
===================================================================
--- gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c	(revision 163286)
+++ gcc/testsuite/gcc.dg/debug/dwarf2/aranges-fnsec-1.c	(working copy)
@@ -5,7 +5,7 @@ 
 /* { dg-options "-gdwarf-2 -ffunction-sections -w -dA" } */
 /* { dg-final { scan-assembler-not "\\.Letext0-\\.Ltext0" } } */
 /* { dg-final { scan-assembler-not "\\.Ltext0\[^\n\r\]*Offset 0x0" } } */
-/* { dg-final { scan-assembler "DW_AT_ranges" } } */
+/* { dg-final { scan-assembler "DW_AT_ranges" { xfail *-*-darwin* } } } */
 
 int
 f (void)