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: PATCH RFA: PR 29286: Handle placement new aliasing issues


On 6/10/07, Eric Botcazou <ebotcazou@adacore.com> wrote:
> Also we won't see (int*alias) except as a cast in the generated C++ IR
> because the type that is returned from placement new is void* and the other
> pointer types that people use will never have TYPE_REF_CAN_ALIAS_ALL
> set on them and it is hard to know what variable would like a type
> which has TYPE_REF_CAN_ALIAS_ALL set on it.

OK, it's true that you need a pointer object to put TYPE_REF_CAN_ALIAS_ALL on
its type, a mere cast somewhere in the IR won't do it.  From your description
I gather that the C++ compiler doesn't generate one for a placement new, in
which case the TYPE_REF_CAN_ALIAS_ALL approach indeed won't work.

It's also that for most uses of placement new the underlying type doesn't change (but is just set for the first time, or just re-initializes an object). In these cases it is important to "strip" the optimization barrier away again.

Richard.


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