------- Comment #5 from pcarlini at suse dot de 2006-09-29 14:52 ------- (In reply to comment #4) > One way to paper over the problem is to move std::new out-of-line :( > Otherwise > I cannot see how we can fix this in libsupc++ without gcc help. Basically we > somehow need to insert (at least) a memory barrier here, like with > > inline void* operator new(std::size_t, void* __p) throw() { > __asm__ volatile ("" : : : "memory"); > return __p; > } > > but that might pessimize code too much.
In case, memory barriers are available, and already used in guard.cc, but indeed, naively, something seems wrong with such a pure-library approach: a memory barrier needed for single thread code?!?! -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286