This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should



------- Comment #33 from ian at airs dot com  2007-05-03 20:33 -------
Created an attachment (id=13504)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13504&action=view)
Patch

Here is a much simpler patch which also fixes the problem.  This simply inserts
a memory clobber before each placement new.  This is safe, but is not as
efficient as possible.  How much do we care about optimizing placement new? 
How often is placement new used in a way which we could in practice optimize
anyhow?

For the test case in this PR, the penalty is pretty severe: gcc can no longer
eliminate the loop.  But this code is obviously artificial in that the loop
serves no purpose.


-- 


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]