> > I'd say they should be optimization barriers too (and at the tree level > > they I think work that way, being represented as function calls), so if > > they don't act as memory barriers in RTL, the *.md patterns should be > > fixed. The only exception should be IMHO the __SYNC_MEM_RELAXED > > variants - if the CPU can reorder memory accesses across them at will, > > why shouldn't the compiler be able to do the same as well? > > Agreed, so we have a bug in all released versions of GCC. :(
I wouldn't go that far. They *used* to be compiler barriers, but clearly something broke at some point without anyone noticing. We don't know how many versions are affected until we debug it. For all we know it broke in 4.5 and 4.4 is fine. There's no reference to a GCC bug report about this in the thread. Did the folks over at the libdispatch project never think to file one? Or does a bug report exist and my search skills are weak? r~