This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should
- From: "ian at airs dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 3 May 2007 19:33:44 -0000
- Subject: [Bug libstdc++/29286] [4.0/4.1/4.2/4.3 Regression] placement new does not change the dynamic type as it should
- References: <bug-29286-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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