From: Martin Mares Date: Fri, 31 Aug 2007 11:42:43 +0000 (+0200) Subject: The GCC bug (I hope I have ruled out all possibilities of a bug at my side) X-Git-Tag: holmes-import~506^2~13^2~66 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=66dfcb94d094eb496bc675234cd15967e1ebd892;p=libucw.git The GCC bug (I hope I have ruled out all possibilities of a bug at my side) turned out to bite even in GCC 4.2.1, so I have reported it and enabled the workaround for all compiler versions. --- diff --git a/lib/sorter/s-multiway.h b/lib/sorter/s-multiway.h index 9295396f..83e928f2 100644 --- a/lib/sorter/s-multiway.h +++ b/lib/sorter/s-multiway.h @@ -44,15 +44,12 @@ static inline void P(update_tree)(P(key) *keys, P(mwt) *tree, uns i) * the tree is the same, the actual key value can differ. */ } -#if defined(__GNUC__) && (__GNUC__ * 1000 + __GNUC_MINOR__ < 4002) /* - * This function sometimes triggers optimizer bugs in GCC 4.1.1 and - * possibly also earlier versions, leading to an assumption that tree[1] - * does not change during this function. We add an explicit memory barrier - * as a work-around. Ugh. + * This function sometimes triggers optimizer bugs in GCC versions up to 4.2.1, + * leading to an assumption that tree[1] does not change during this function. + * We add an explicit memory barrier as a work-around. Ugh. See GCC Bug #33262. */ asm volatile ("" : : : "memory"); -#endif } static inline void P(set_tree)(P(key) *keys, P(mwt) *tree, uns i, int val)