This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RE: emulating tls for systems without
- From: Danny Smith <dannysmith at clear dot net dot nz>
- To: 'Richard Henderson' <rth at redhat dot com>
- Cc: 'Jakub Jelinek' <jakub at redhat dot com>, 'Diego Novillo' <dnovillo at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Sat, 30 Sep 2006 21:46:40 +1200
- Subject: RE: emulating tls for systems without
> From: Richard Henderson
> Sent: Wednesday, 27 September 2006 6:58 a.m.
>
> On Tue, Sep 26, 2006 at 04:12:53PM +1200, Danny Smith wrote:
> > FAIL: libgomp.c/barrier-1.c execution test
>
> This one's concerning. It's likely to be a pthreads bug.
>
>
This is a timer resolution problem too. If I replace gettimeofday with
an RDTSC asm (or with the Win32-specific
QueryPerformanceCounter), barrier-1.c passes.
Alternatively, changing the '<' comparison to '<=' also allows it to
pass with a low resolution timer.
So libgomp works for mingw32. Thanks to all..
Danny
Index: barrier-1.c
===================================================================
--- barrier-1.c (revision 117300)
+++ barrier-1.c (working copy)
@@ -38,13 +38,13 @@
function (NULL);
GOMP_parallel_end ();
- assert (timercmp (&stamps[0][0], &stamps[0][1], <));
- assert (timercmp (&stamps[1][0], &stamps[0][1], <));
- assert (timercmp (&stamps[2][0], &stamps[0][1], <));
+ assert (!timercmp (&stamps[0][0], &stamps[0][1], >));
+ assert (!timercmp (&stamps[1][0], &stamps[0][1], >));
+ assert (!timercmp (&stamps[2][0], &stamps[0][1], >));
- assert (timercmp (&stamps[0][1], &stamps[0][2], <));
- assert (timercmp (&stamps[0][1], &stamps[1][2], <));
- assert (timercmp (&stamps[0][1], &stamps[2][2], <));
+ assert (!timercmp (&stamps[0][1], &stamps[0][2], >));
+ assert (!timercmp (&stamps[0][1], &stamps[1][2], >));
+ assert (!timercmp (&stamps[0][1], &stamps[2][2], >));
return 0;
}