This is the mail archive of the gcc-patches@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]

Re: [C++ PATCH] Fix placement new if operator new has 2nd argument REFERENCE_TYPE (PR c++/34862)


On Feb 5, 2008 6:25 PM, Jason Merrill <jason@redhat.com> wrote:
> It seems to me that this (and Ian's original patch) are approaching this
> problem the wrong way: we shouldn't be trying to guess whether a pointer
> is changing type based on the form of the call to new; this won't handle
> a user-defined placement new, or a user-defined override of the
> non-placement operator new which always returns the same pointer.  Can't
> we attach the CHANGE_DYNAMIC_TYPE_EXPR to the value returned from
> operator new, rather than mess with the arguments?

The problem arises at the point of inlining, where the optimizers need to see
that at the _beginning_ of the inlined new operator the dynamic type
of the storage is changing.  So it's not enough to mark its result as
having a distinct type.

Richard.


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