From: Bart Van Assche Date: Sat, 11 Sep 2010 10:00:22 +0000 (+0000) Subject: Implemented a workaround for a PowerPC-specific gcc-4.3.2-7.x86_64 bug. See also X-Git-Tag: svn/VALGRIND_3_6_0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6cf46444c689cb86a0a786dd30abdb4d689375a;p=thirdparty%2Fvalgrind.git Implemented a workaround for a PowerPC-specific gcc-4.3.2-7.x86_64 bug. See also http://sourceforge.net/mailarchive/forum.php?thread_name=201009101114.07127.jseward%40acm.org&forum_name=valgrind-developers git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11353 --- diff --git a/drd/tests/annotate_hb_err.stderr.exp b/drd/tests/annotate_hb_err.stderr.exp index 50f51e070a..b52069bf1b 100644 --- a/drd/tests/annotate_hb_err.stderr.exp +++ b/drd/tests/annotate_hb_err.stderr.exp @@ -1,12 +1,14 @@ wrong type of synchronization object - at 0x........: main (annotate_hb_err.c:?) + at 0x........: U_AnnotateHappensBefore (unified_annotations.h:?) + by 0x........: main (annotate_hb_err.c:?) mutex 0x........ was first observed at: at 0x........: pthread_mutex_init (drd_pthread_intercepts.c:?) by 0x........: main (annotate_hb_err.c:?) wrong type of synchronization object - at 0x........: main (annotate_hb_err.c:?) + at 0x........: U_AnnotateHappensBefore (unified_annotations.h:?) + by 0x........: main (annotate_hb_err.c:?) cond 0x........ was first observed at: at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) by 0x........: main (annotate_hb_err.c:?) @@ -15,7 +17,8 @@ wrong type of synchronization object at 0x........: pthread_cond_init (drd_pthread_intercepts.c:?) by 0x........: main (annotate_hb_err.c:?) order annotation 0x........ was first observed at: - at 0x........: main (annotate_hb_err.c:?) + at 0x........: U_AnnotateHappensAfter (unified_annotations.h:?) + by 0x........: main (annotate_hb_err.c:?) Done. diff --git a/drd/tests/unified_annotations.h b/drd/tests/unified_annotations.h index c5151cd778..13259d6fc9 100644 --- a/drd/tests/unified_annotations.h +++ b/drd/tests/unified_annotations.h @@ -11,16 +11,8 @@ * http://code.google.com/p/data-race-test/source/browse/trunk/dynamic_annotations/dynamic_annotations.h */ #define U_ANNOTATE_NEW_MEMORY(addr, size) ANNOTATE_NEW_MEMORY(addr, size) -#define U_ANNOTATE_HAPPENS_BEFORE(addr) \ - do { \ - ANNOTATE_HAPPENS_BEFORE(addr); \ - AnnotateCondVarSignal(__FILE__, __LINE__, addr); \ - } while(0) -#define U_ANNOTATE_HAPPENS_AFTER(addr) \ - do { \ - ANNOTATE_HAPPENS_AFTER(addr); \ - AnnotateCondVarWait(__FILE__, __LINE__, addr, NULL); \ - } while(0) +#define U_ANNOTATE_HAPPENS_BEFORE(addr) U_AnnotateHappensBefore(addr) +#define U_ANNOTATE_HAPPENS_AFTER(addr) U_AnnotateHappensAfter(addr) #define U_ANNOTATE_HAPPENS_DONE(addr) \ do { \ ANNOTATE_HAPPENS_DONE(addr); \ @@ -48,6 +40,18 @@ AnnotateCondVarWait(const char *file, int line, const volatile void *cv, asm(""); } +static __inline__ void U_AnnotateHappensBefore(void* addr) +{ + ANNOTATE_HAPPENS_BEFORE(addr); + AnnotateCondVarSignal(__FILE__, __LINE__, addr); +} + +static __inline__ void U_AnnotateHappensAfter(void *addr) +{ + ANNOTATE_HAPPENS_AFTER(addr); + AnnotateCondVarWait(__FILE__, __LINE__, addr, NULL); +} + #if 0 {