diff mbox

Fix tsan tests.

Message ID 52A6E359.1090201@partner.samsung.com
State New
Headers show

Commit Message

max Dec. 10, 2013, 9:48 a.m. UTC
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
2013-12-10  Max Ostapenko  <m.ostapenko@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.

Comments

Jakub Jelinek Dec. 10, 2013, 9:49 a.m. UTC | #1
On Tue, Dec 10, 2013 at 01:48:09PM +0400, Maxim Ostapenko wrote:
> 2013-12-10  Max Ostapenko  <m.ostapenko@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.

Ok, thanks.

	Jakub
Yury Gribov Dec. 10, 2013, 10:44 a.m. UTC | #2
Done, r205853.
H.J. Lu Dec. 10, 2013, 1:10 p.m. UTC | #3
On Tue, Dec 10, 2013 at 2:44 AM, Yury Gribov <y.gribov@samsung.com> wrote:
> Done, r205853.

I think it caused:

http://gcc.gnu.org/ml/gcc-regression/2013-12/msg00214.html
Jakub Jelinek Dec. 10, 2013, 1:18 p.m. UTC | #4
On Tue, Dec 10, 2013 at 05:10:44AM -0800, H.J. Lu wrote:
> On Tue, Dec 10, 2013 at 2:44 AM, Yury Gribov <y.gribov@samsung.com> wrote:
> > Done, r205853.
> 
> I think it caused:
> 
> http://gcc.gnu.org/ml/gcc-regression/2013-12/msg00214.html

Missing torture-finish before dg-finish?  At least looking at other
*.exp files that do set-torture-options they all do that.

	Jakub
Yury Gribov Dec. 10, 2013, 1:20 p.m. UTC | #5
HJ wrote:
 >> Done, r205853.
 > I think it caused:
 > http://gcc.gnu.org/ml/gcc-regression/2013-12/msg00214.html

Right, I think we are missing torture-finish. Will send a fix after test.

-Y
Jakub Jelinek Dec. 10, 2013, 3:37 p.m. UTC | #6
On Tue, Dec 10, 2013 at 07:06:21PM +0400, Yury Gribov wrote:
> --- a/gcc/testsuite/g++.dg/tsan/tsan.exp
> +++ b/gcc/testsuite/g++.dg/tsan/tsan.exp
> @@ -42,5 +42,6 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common
>  }
>  
>  # All done.
> +torture-finish
>  tsan_finish
>  dg-finish
> diff --git a/gcc/testsuite/gcc.dg/tsan/tsan.exp b/gcc/testsuite/gcc.dg/tsan/tsan.exp
> index a4a5b72..c70021c 100644
> --- a/gcc/testsuite/gcc.dg/tsan/tsan.exp
> +++ b/gcc/testsuite/gcc.dg/tsan/tsan.exp
> @@ -42,5 +42,6 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common
>  }
>  
>  # All done.
> +torture-finish
>  tsan_finish
>  dg-finish

I'd prefer to put torture-finish after tsan_finish, so that
destruction is done in reverse order from construction.
Ok with that change.

> 2013-12-10  Yury Gribov  <y.gribov@samsung.com>
> 
> 	* gcc-dg/tsan/tsan.exp: Added missing call to torture-finish.
> 	* g++-dg/tsan/tsan.exp: Likewise.

	Jakub
Yury Gribov Dec. 10, 2013, 3:52 p.m. UTC | #7
Done in r205858.

-----------------------------------------------
From: Jakub Jelinek <jakub@redhat.com>
Sent:  Tuesday, December 10, 2013 7:37PM
To: Yury Gribov <y.gribov@samsung.com>
Cc: H.J. Lu <hjl.tools@gmail.com>, Maxim Ostapenko 
<m.ostapenko@partner.samsung.com>, GCC Patches 
<gcc-patches@gcc.gnu.org>, Slava Garbuzov <v.garbuzov@samsung.com>
Subject: Re: Fix tsan tests.

On 12/10/2013 07:37 PM, Jakub Jelinek wrote:

On Tue, Dec 10, 2013 at 07:06:21PM +0400, Yury Gribov wrote:

> --- a/gcc/testsuite/g++.dg/tsan/tsan.exp
> +++ b/gcc/testsuite/g++.dg/tsan/tsan.exp
> @@ -42,5 +42,6 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common
>   }
>   
>   # All done.
> +torture-finish
>   tsan_finish
>   dg-finish
> diff --git a/gcc/testsuite/gcc.dg/tsan/tsan.exp b/gcc/testsuite/gcc.dg/tsan/tsan.exp
> index a4a5b72..c70021c 100644
> --- a/gcc/testsuite/gcc.dg/tsan/tsan.exp
> +++ b/gcc/testsuite/gcc.dg/tsan/tsan.exp
> @@ -42,5 +42,6 @@ gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.c $srcdir/c-c++-common
>   }
>   
>   # All done.
> +torture-finish
>   tsan_finish
>   dg-finish

I'd prefer to put torture-finish after tsan_finish, so that
destruction is done in reverse order from construction.
Ok with that change.

> 2013-12-10  Yury Gribov  <y.gribov@samsung.com>
>
> 	* gcc-dg/tsan/tsan.exp: Added missing call to torture-finish.
> 	* g++-dg/tsan/tsan.exp: Likewise.

	Jakub
Mike Stump Dec. 10, 2013, 8:26 p.m. UTC | #8
On Dec 10, 2013, at 7:06 AM, Yury Gribov <y.gribov@samsung.com> wrote:
> Jakub wrote:
> > HJ wrote:
> >>> Done, r205853.
> >> I think it caused:
> >>
> >> http://gcc.gnu.org/ml/gcc-regression/2013-12/msg00214.html
> >
> > Missing torture-finish before dg-finish? At least looking at other
> > *.exp files that do set-torture-options they all do that.
> 
> Full make-check is still running but I was able to repro this with `make check RUNTESTFLAGS='tsan.exp i386-prefetch.exp math-torture.exp'. Attached patch is tested against these exps as well. Ok to commit or should I wait for make-check to complete? I'd prefer to unblock other developers ASAP.

I'm ok with correcting things with subset testing, but just be careful.  The full test suite can in some instances show how one test case driver can knock into the next in a bad way, so when changing things that might knock, one still needs to do a full run and ensure no fallout.
diff mbox

Patch

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.