This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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;
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]