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: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 May 2007 11:03:54 -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 #43 from pcarlini at suse dot de 2007-05-04 12:03 -------
(In reply to comment #42)
> this happens in hot tramp3d loops and is a quite common idiom for initializing
> storage. To fix this we need to avoid creating the asm if the type of the
> original storage is the same as the other.
Many thanks Richard. Indeed, I find this already mentioned optimization a very
sensible thing to add.
(By the way, someone should tell the tramp3d developers that using placement
new for a POD type like double isn't a very smart idea ;) The only tricky point
for default inizialization is whether using memset or a plain loop)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286