https://gcc.gnu.org/g:1504073ad89f4dff7243dea608f385d3fa8cc89a

commit r15-4809-g1504073ad89f4dff7243dea608f385d3fa8cc89a
Author: Joseph Myers <josmy...@redhat.com>
Date:   Thu Oct 31 17:01:09 2024 +0000

    testsuite: Use noinline in gcc.dg/simulate-thread/simulate-thread.h
    
    Among the changes of test results with a -std=gnu23 default were two
    tests changing from PASS to UNSUPPORTED:
    
    UNSUPPORTED: gcc.dg/simulate-thread/speculative-store.c   -O2 -g  thread 
simulation test
    UNSUPPORTED: gcc.dg/simulate-thread/speculative-store.c   -O3 -g  thread 
simulation test
    
    It appears that functions defined with () becoming prototyped affects
    inlining, and changing the code to use (void) allows UNSUPPORTED
    results to be reproduced with -std=gnu17.  Add __attribute__
    ((noinline)) on one more function to avoid the UNSUPPORTED results;
    some of the tests in this directory already have such an attribute on
    some functions.
    
    Tested for x86_64-pc-linux-gnu.
    
            * gcc.dg/simulate-thread/simulate-thread.h
            (simulate_thread_wrapper_final_verify): Mark noinline.

Diff:
---
 gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h 
b/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h
index 22c05084ee74..b582220694e5 100644
--- a/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h
+++ b/gcc/testsuite/gcc.dg/simulate-thread/simulate-thread.h
@@ -116,7 +116,7 @@ simulate_thread_wrapper_other_threads()
 
 /* If the test case defines HOSTILE_PAUSE_ERROR, then the test case
    will fail execution if it had a hostile pause.  */
-int
+__attribute__ ((noinline)) int
 simulate_thread_wrapper_final_verify ()
 {
   int ret = simulate_thread_final_verify ();

Reply via email to