------- Comment #32 from mark at codesourcery dot com  2007-05-02 21:41 -------
Subject: Re:  [4.0/4.1/4.2/4.3 Regression] placement
 new does not change the dynamic type as it should

ian at airs dot com wrote:

> Here is one approach which fixes the test case.  This introduces a new tree
> code, ALIASING_CONVERT_EXPR.  It is conveyed into RTL via a flag on REGS:
> REG_ALIAS_ALL.   I didn't try to really union the alias sets, I just said that
> the result of placement new can alias anything.  This patch is essentially
> untested.

I think this is a reasonable approach  I agree that it will require care
to make sure this is threaded through the compiler in all places (for
example, we may need variants of STRIP_NOPs that do/don't strip it), but
anything else is going to be too pessimistic.

I think that creating a separate type, with TYPE_REF_CAN_ALIAS_ALL set,
is worse: it's not the type of the expression that matters, but the
action of the expression itself.  It's the act of placement-newing that
destroys type information; after that, the type that you have is what
you expect.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286

Reply via email to