Hello,

From http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59410#c1 issue:

> BTW, the tsan.exp tests don't seem to be as cheap as was claimed during the patch > submission, I'd prefer to at least throttle the > torture options down to say -O0 > and -O2 rather than so many different variants when the tests are really small and
> optimizations don't really affect them that much if at all.

I've fixed tsan tests to be executed only with '-O0' and '-O2' options.
The number of tests executed is decreased from 272 to 68.
Ok to commit?

-Maxim
diff --git a/gcc/testsuite/c-c++-common/tsan/thread_leak2.c b/gcc/testsuite/c-c++-common/tsan/thread_leak2.c
index 12ac734..d6f4e22 100644
--- a/gcc/testsuite/c-c++-common/tsan/thread_leak2.c
+++ b/gcc/testsuite/c-c++-common/tsan/thread_leak2.c
@@ -1,6 +1,5 @@
 /* { dg-do run } */
 /* { dg-shouldfail "tsan" } */
-/* { dg-skip-if "" { *-*-* }  { "-O3 -funroll-loops" "-O3 -funroll-all-loops" } { "" } } */
 
 #include <pthread.h>
 #include <unistd.h>
diff --git a/gcc/testsuite/g++.dg/tsan/tsan.exp b/gcc/testsuite/g++.dg/tsan/tsan.exp
index 164a92e..68b1d83 100644
--- a/gcc/testsuite/g++.dg/tsan/tsan.exp
+++ b/gcc/testsuite/g++.dg/tsan/tsan.exp
@@ -21,6 +21,7 @@
 # Load support procs.
 load_lib g++-dg.exp
 load_lib tsan-dg.exp
+load_lib torture-options.exp
 
 if ![check_effective_target_fthread_sanitizer] {
   return
@@ -28,6 +29,11 @@ if ![check_effective_target_fthread_sanitizer] {
 
 # Initialize `dg'.
 dg-init
+torture-init
+set-torture-options [list \
+	{ -O0 } \
+	{ -O2 } ]
+
 if [tsan_init] {
 
 # Main loop.
diff --git a/gcc/testsuite/gcc.dg/tsan/tsan.exp b/gcc/testsuite/gcc.dg/tsan/tsan.exp
index 248cfb1..a4a5b72 100644
--- a/gcc/testsuite/gcc.dg/tsan/tsan.exp
+++ b/gcc/testsuite/gcc.dg/tsan/tsan.exp
@@ -21,6 +21,7 @@
 # Load support procs.
 load_lib gcc-dg.exp
 load_lib tsan-dg.exp
+load_lib torture-options.exp
 
 if ![check_effective_target_fthread_sanitizer] {
   return
@@ -28,6 +29,11 @@ if ![check_effective_target_fthread_sanitizer] {
 
 # Initialize `dg'.
 dg-init
+torture-init
+set-torture-options [list \
+	{ -O0 } \
+	{ -O2 } ]
+
 if [tsan_init] {
 
 # Main loop.
2013-12-10  Max Ostapenko  <m.ostape...@partner.samsung.com>

        * c-c++-common/tsan/thread_leak2.c: `dg-skip-if' removed.
        * gcc-dg/tsan/tsan.exp: Run only with '-O0' and '-O2' options.
        * g++-dg/tsan/tsan.exp: Run only with '-O0' and '-O2' options.

Reply via email to