|
From: <sv...@va...> - 2010-09-11 10:00:31
|
Author: bart Date: 2010-09-11 11:00:22 +0100 (Sat, 11 Sep 2010) New Revision: 11353 Log: 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 Modified: trunk/drd/tests/annotate_hb_err.stderr.exp trunk/drd/tests/unified_annotations.h Modified: trunk/drd/tests/annotate_hb_err.stderr.exp =================================================================== --- trunk/drd/tests/annotate_hb_err.stderr.exp 2010-09-10 14:57:46 UTC (rev 11352) +++ trunk/drd/tests/annotate_hb_err.stderr.exp 2010-09-11 10:00:22 UTC (rev 11353) @@ -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 @@ 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. Modified: trunk/drd/tests/unified_annotations.h =================================================================== --- trunk/drd/tests/unified_annotations.h 2010-09-10 14:57:46 UTC (rev 11352) +++ trunk/drd/tests/unified_annotations.h 2010-09-11 10:00:22 UTC (rev 11353) @@ -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,7 +40,19 @@ 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 { #endif |