------- Comment #9 from bart dot vanassche at gmail dot com  2009-06-13 16:23 
-------
(In reply to comment #7)

The patch below is sufficient to suppress all conflicting accesses reported by
DRD. I've done my best to ensure that this patch is not only sufficient but
also minimal. Although Jakub Jelinek has already explained that the access
pattern of gomp_work_share::next_ws is safe, there are several other members of
struct gomp_work_share that have to be verified too.

$ diff -upr orig/gcc-4.4.0/libgomp gcc-4.4.0/libgomp
diff -upr orig/gcc-4.4.0/libgomp/work.c gcc-4.4.0/libgomp/work.c
--- orig/gcc-4.4.0/libgomp/work.c       2009-04-10 01:23:07.000000000 +0200
+++ gcc-4.4.0/libgomp/work.c    2009-06-13 18:00:55.000000000 +0200        
@@ -29,6 +29,7 @@
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
+#include <valgrind/drd.h>


 /* Allocate a new work share structure, preferably from current team's
@@ -92,6 +93,14 @@ void
 gomp_init_work_share (struct gomp_work_share *ws, bool ordered,
                      unsigned nthreads)
 {
+  DRD_IGNORE_VAR(ws->chunk_size);
+  DRD_IGNORE_VAR(ws->end);
+  DRD_IGNORE_VAR(ws->incr);
+  DRD_IGNORE_VAR(ws->mode);
+  DRD_IGNORE_VAR(ws->next);
+  DRD_IGNORE_VAR(ws->next_ws);
+  DRD_IGNORE_VAR(ws->threads_completed);
+
   gomp_mutex_init (&ws->lock);
   if (__builtin_expect (ordered, 0))
     {


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40362

Reply via email to