The following avoids inlining the actual main() (renamed to
guality_main) into the guality plumbing.  This can cause
jump threading opportunities to appear and generally increase
the chance what we actually test isn't what we think.  Likewise
make guality_check noipa instead of just noinline.

Bootstrapped and tested on x86_64-unknown-linux-gnu.  With -m32
for me this adds

+FAIL: gcc.dg/guality/pr41447-1.c   -O2 -flto -fuse-linker-plugin 
-fno-fat-lto-o
bjects  -DPREVENT_OPTIMIZATION execution test
+FAIL: gcc.dg/guality/pr41447-1.c   -O3 -g  -DPREVENT_OPTIMIZATION  
execution te
st
+FAIL: gcc.dg/guality/pr41447-1.c   -Os  -DPREVENT_OPTIMIZATION  execution 
test

on my testing machine.  It avoids an additional FAIL with another
patch I am testing that exposes a jump threading opportunity
in main with guality_main inlined.

OK for trunk?

Thanks,
Richard.

gcc/testsuite/
        * gcc.dg/guality/guality.h (guality_main): Declare noipa.
        (guality_check): Likewise.
---
 gcc/testsuite/gcc.dg/guality/guality.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/guality/guality.h 
b/gcc/testsuite/gcc.dg/guality/guality.h
index d41327c24d5..48b59d2e324 100644
--- a/gcc/testsuite/gcc.dg/guality/guality.h
+++ b/gcc/testsuite/gcc.dg/guality/guality.h
@@ -204,9 +204,10 @@ int volatile guality_attached;
    of this wrapping, guality_main may not have an empty argument
    list.  */
 
-extern int guality_main (int argc, char *argv[]);
+extern int __attribute__((noipa))
+guality_main (int argc, char *argv[]);
 
-static void __attribute__((noinline))
+static void __attribute__((noipa))
 guality_check (const char *name, gualchk_t value, int unknown_ok);
 
 /* Set things up, run guality_main, then print a summary and quit.  */
-- 
2.43.0

Reply via email to