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 #64 from ian at airs dot com  2007-05-14 17:42 -------
Re: comment #59: CHANGE_DYNAMIC_TYPE_EXPR does not have a result.  I set it up
so that it is essentially volatile, and represents an additional type aliasing
at that point in the program.

One of the earlier patches set it up as a cast.  But it was hard to convince
myself that it really did the right thing.  A lot of code in the compiler
strips casts for one reason or another.  One would have to examine each of
those places and make sure that it did not strip the cast inappropriately.  Or,
conversely, that it did strip the cast when it should.  This would tend to
introduce a bit of code in many different parts of the compiler, all to handle
a very unusual case.

Generating a statement with no result seemed more reliable to me.  It's true
that there is a downside: it may cause a placement new to be preserved
inappropriately.  But that seems like an unlikely case to me.  I doubt that
very much code does a placement new which changes types and then does not use
the resulting memory.  I think it's OK to misoptimize such code slightly.


-- 


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]