https://gcc.gnu.org/g:06ffbbaee89b89789aaaa2c7086fa8536632e80d

commit r16-5571-g06ffbbaee89b89789aaaa2c7086fa8536632e80d
Author: Rainer Orth <[email protected]>
Date:   Tue Nov 25 09:20:54 2025 +0100

    testsuite: i386: Guard NO_PROFILE_COUNTERS tests
    
    After switching the i386 check-function-bodies tests to use the new
    dg-add-options check_function_bodies feature, several tests still FAIL
    in similar ways on Solaris/x86:
    
    * Some FAIL like this:
    
    FAIL: gcc.target/i386/pr120936-6.c (test for excess errors)
    Excess errors:
    cc1: error: '-mnop-mcount' is not compatible with this target
    
      This happens because -mnop-mcount is only supported in
      i386/i386-options.cc (ix86_option_override_internal) if
      NO_PROFILE_COUNTERS.
    
    * Others FAIL like
    
    FAIL: gcc.target/i386/pr120936-10.c (test for excess errors)
    Excess errors:
    gcc/testsuite/gcc.target/i386/pr120936-10.c:23:1: sorry, unimplemented: 
profiling '-mcmodel=large' with PIC is not supported
    
      This error is generated in i386/i386.cc (x86_function_profiler) if
      !NO_PROFILE_COUNTERS.
    
    NO_PROFILE_COUNTERS is only defined in dragonfly.h, x86_64.sh,
    gnu-user.h, freebsd.h, cygming.h, and, netbsd-elf.h.  However, a couple
    of similar tests are restricted to Linux only, so this patch follows
    suit.  One could introduce a new effective-target keyword to fully
    handle this, though.
    
    Tested on i386-pc-solaris2.11 and x86_64-pc-linux-gnu.
    
    2025-11-23  Rainer Orth  <[email protected]>
    
            gcc/testsuite:
            * gcc.target/i386/pr120936-3.c: Restrict to *-*-linux*.
            * gcc.target/i386/pr120936-6.c: Likewise.
            * gcc.target/i386/pr120936-10.c: Likewise.
            * gcc.target/i386/pr120936-12.c: Likewise.

Diff:
---
 gcc/testsuite/gcc.target/i386/pr120936-10.c | 2 +-
 gcc/testsuite/gcc.target/i386/pr120936-12.c | 2 +-
 gcc/testsuite/gcc.target/i386/pr120936-3.c  | 2 +-
 gcc/testsuite/gcc.target/i386/pr120936-6.c  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/testsuite/gcc.target/i386/pr120936-10.c 
b/gcc/testsuite/gcc.target/i386/pr120936-10.c
index ab95b087ec9b..6107a5ccabcb 100644
--- a/gcc/testsuite/gcc.target/i386/pr120936-10.c
+++ b/gcc/testsuite/gcc.target/i386/pr120936-10.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { fpic && lp64 } } } */
+/* { dg-do compile { target { { *-*-linux* && lp64 } && fpic } } } */
 /* { dg-options "-O2 -mcmodel=large -pg -mno-fentry -fpic -fno-shrink-wrap" } 
*/
 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
 /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } 
{^(1|\t?\.)} } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr120936-12.c 
b/gcc/testsuite/gcc.target/i386/pr120936-12.c
index b5a2aaced5d8..fdeaf6755561 100644
--- a/gcc/testsuite/gcc.target/i386/pr120936-12.c
+++ b/gcc/testsuite/gcc.target/i386/pr120936-12.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target { fpic && lp64 } } } */
+/* { dg-do compile { target { { *-*-linux* && lp64 } && fpic } } } */
 /* { dg-options "-O2 -mcmodel=large -mrecord-mcount -pg -mno-fentry -fpic 
-fno-shrink-wrap" } */
 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
 /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } 
{^(1|\t?\.)} } } */
diff --git a/gcc/testsuite/gcc.target/i386/pr120936-3.c 
b/gcc/testsuite/gcc.target/i386/pr120936-3.c
index dc0a8f1e4243..44a117345bbb 100644
--- a/gcc/testsuite/gcc.target/i386/pr120936-3.c
+++ b/gcc/testsuite/gcc.target/i386/pr120936-3.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target fpic } } */
+/* { dg-do compile { target { *-*-linux* && fpic } } } */
 /* { dg-options "-O2 -mnop-mcount -pg -mno-fentry -fno-pic -fno-shrink-wrap" } 
*/
 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
 /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } {^\t?\.} } 
} */
diff --git a/gcc/testsuite/gcc.target/i386/pr120936-6.c 
b/gcc/testsuite/gcc.target/i386/pr120936-6.c
index 6e2290fda6e8..013b5e89cab5 100644
--- a/gcc/testsuite/gcc.target/i386/pr120936-6.c
+++ b/gcc/testsuite/gcc.target/i386/pr120936-6.c
@@ -1,4 +1,4 @@
-/* { dg-do compile { target fpic } } */
+/* { dg-do compile { target { *-*-linux* && fpic } } } */
 /* { dg-options "-O2 -mrecord-mcount -mnop-mcount -pg -mno-fentry -fno-pic 
-fno-shrink-wrap" } */
 /* Keep labels and directives ('.cfi_startproc', '.cfi_endproc').  */
 /* { dg-final { check-function-bodies "**" "" "" { target "*-*-*" } 
{^(1|\t?\.)} } } */

Reply via email to