> On 28 Dec 2025, at 10:09, Rainer Orth <[email protected]> wrote:
> 
> Several recent tests that use check-function-bodies on x86 FAIL on
> Solaris: they all lack dg-add-options check_function_bodies which is
> required to handle some Solaris differences.  One test also needs
> -fomit-frame-pointer to deal with a different Solaris/x86 default.
> 
> Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.
> 
> Committed to trunk.
> 
> 
> I'm increasingly disconcerted with HJ's constant disregard for the
> requirements of non-Linux targets.  This issue has been known for months
> and the fix is well-known, but every new set of check-function-bodies
> tests had the same issue.  I've lost count of how many times I had to
> fix them up subsequently.  Even after I introduced dg-add-options
> check_function_bodies to make this as easy as possible, it was again
> ignored.
> 
> Darwin is way worse off than Solaris here: currently all
> check-function-bodies tests FAIL on Darwin/x86.  For one, they need to
> use -fdwarf2-cfi-asm to enforce the generation of the cfi directives.
> However, I wonder if those have any bearing on what the tests check for
> or are just present because they are generated by default on Linux.
> Apart from that (easily handled with the dg-add-options above), there
> are more differences:
> 
> * Some are merely syntactical, like the use of L<N> for labels instead
>  of .L<N>.  Those can/could be handled in scanasm.exp, but there are
>  several more, e.g. lC<N> instead of .LC<N> , so I gave up on an
>  initial attempt to fix this.
> 
> * Unfortunately there are also some codegen differences that Iain is
>  currently trying to handle in some way.
> 
> If this shouldn't work out, Darwin is faced with ca. 150 testsuite
> failures due to this single issue.  While one could xfail the dg-final
> on darwin (which would likely be forgotten just like the Solaris issue
> above), it would be better to introduce a new effective-target keyword
> to handle the problem if more platforms with similar issues come up.

+1 To Rainer’s comments,  x86 has many sub-ports, it is not reasonable
to commit testcases without any consideration of this (especially for very
experienced developers).  Often there are quite trivial issues that occur
again and again (missing __USER_LOCAL_PREFIX__, assumptions
that all targets are ELF, etc).

It is very unfortunate that Darwin and Solaris maintainers end up picking
up most of the extra work - since those are the sub-ports most frequently
tested.

I have patches in progress to improve the scan function (making it more
flexible) and to fix up many of the Darwin fails - hopefully I will be able to
post these before the end of stage #3 (although ISTR that release managers
will regard tests that never passed in the same category as regressions so
perhaps there will be some lattitude if the effort slips in the stage #4)

Iain

regards test 
> 
> Rainer
> 
> -- 
> -----------------------------------------------------------------------------
> Rainer Orth, Center for Biotechnology, Bielefeld University
> 
> 
> 2025-12-10  Rainer Orth  <[email protected]>
> 
> * gcc.target/i386/20040112-1.c: Add dg-add-options
> check_function_bodies.
> * gcc.target/i386/pr122343-1a.c: Likewise.
> * gcc.target/i386/pr122343-1b.c: Likewise.
> * gcc.target/i386/pr122343-2a.c: Likewise.
> * gcc.target/i386/pr122343-2b.c: Likewise.
> * gcc.target/i386/pr122343-3.c: Likewise.
> * gcc.target/i386/pr122343-4a.c: Likewise.
> * gcc.target/i386/pr122343-4b.c: Likewise.
> * gcc.target/i386/pr122343-5a.c: Likewise.
> * gcc.target/i386/pr122343-5b.c: Likewise.
> * gcc.target/i386/pr122343-6a.c: Likewise.
> * gcc.target/i386/pr122343-6b.c: Likewise.
> * gcc.target/i386/pr122343-7.c: Likewise.
> * gcc.target/i386/pr122675-1.c: Likewise.
> (dg-options): Add -fomit-frame-pointer.
> 
> # HG changeset patch
> # Parent  d001d61ca675e92f9974ea494c9b8b41584942d4
> testsuite: i386: Fix up check-function-bodies tests
> 
> diff --git a/gcc/testsuite/gcc.target/i386/20040112-1.c 
> b/gcc/testsuite/gcc.target/i386/20040112-1.c
> --- a/gcc/testsuite/gcc.target/i386/20040112-1.c
> +++ b/gcc/testsuite/gcc.target/i386/20040112-1.c
> @@ -1,6 +1,7 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> /* { dg-additional-options "-mregparm=1" { target ia32 } } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1a.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-1a.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-1a.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-1a.c
> @@ -1,6 +1,7 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> /* { dg-additional-options "-mregparm=1" { target ia32 } } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-1b.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-1b.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-1b.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-1b.c
> @@ -1,6 +1,7 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" 
> } */
> /* { dg-additional-options "-mregparm=1" { target ia32 } } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-2a.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-2a.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-2a.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-2a.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-2b.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-2b.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-2b.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-2b.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" 
> } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-3.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-3.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-3.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-3.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-4a.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-4a.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-4a.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-4a.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-4b.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-4b.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-4b.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-4b.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" 
> } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5a.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-5a.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-5a.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-5a.c
> @@ -1,6 +1,7 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> /* { dg-additional-options "-mregparm=1" { target ia32 } } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-5b.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-5b.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-5b.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-5b.c
> @@ -1,6 +1,7 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" 
> } */
> /* { dg-additional-options "-mregparm=1" { target ia32 } } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-6a.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-6a.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-6a.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-6a.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target { *-*-* } } 
> {^\t?\.} } } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-6b.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-6b.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-6b.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-6b.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer -fno-fuse-ops-with-volatile-access" 
> } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122343-7.c 
> b/gcc/testsuite/gcc.target/i386/pr122343-7.c
> --- a/gcc/testsuite/gcc.target/i386/pr122343-7.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122343-7.c
> @@ -1,5 +1,6 @@
> /* { dg-do compile } */
> /* { dg-options "-O2 -fomit-frame-pointer" } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target *-*-* } {^\t?\.} } 
> } */
> 
> diff --git a/gcc/testsuite/gcc.target/i386/pr122675-1.c 
> b/gcc/testsuite/gcc.target/i386/pr122675-1.c
> --- a/gcc/testsuite/gcc.target/i386/pr122675-1.c
> +++ b/gcc/testsuite/gcc.target/i386/pr122675-1.c
> @@ -1,6 +1,7 @@
> /* Verify that the most likely BB edges are optimized as fallthroughs.  */
> /* { dg-do compile } */
> -/* { dg-options "-O1 -fno-pic -march=x86-64 -mtune=generic 
> -mgeneral-regs-only" } */
> +/* { dg-options "-O1 -fno-pic -march=x86-64 -mtune=generic 
> -mgeneral-regs-only -fomit-frame-pointer" } */
> +/* { dg-add-options check_function_bodies } */
> /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
> /* { dg-final { check-function-bodies "**" "" "" { target lp64 } {^\t?\.} } } 
> */
> 

Reply via email to