[Bug libstdc++/29286] [4.2 Regression] placement new does not provide required side-effects

rguenth at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Sep 29 14:38:00 GMT 2006



------- Comment #4 from rguenth at gcc dot gnu dot org  2006-09-29 14:38 -------
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.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286



More information about the Gcc-bugs mailing list