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: "gdr at cs dot tamu dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 May 2007 21:17:01 -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 #103 from gdr at cs dot tamu dot edu 2007-05-18 22:16 -------
Subject: Re: [4.0/4.1/4.2/4.3 Regression] placement new does not change the
dynamic type as it should
"pcarlini at suse dot de" <gcc-bugzilla@gcc.gnu.org> writes:
| ------- Comment #98 from pcarlini at suse dot de 2007-05-18 21:27 -------
| (In reply to comment #97)
| > First and foremeost, we have to generate correct code. If that means
| > the memory barrier solution, for now, then so be it.
|
| Yes, but I'm a little worried myself not by <memory> but by containers like
| <list>, <map> and <set>, where we call allocator::contruct, which uses
| placement new, to "install" the value in the allocated node. In that case,
| unfortunately, per 20.4.1.1/12, we can't optimize it for POD types :( At
| minimum we should benchmark a bit...
If the element type is a POD, we should use assignment, not placement new.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286