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


Eric Botcazou <ebotcazou@adacore.com> writes:

> > But CHANGE_DYNAMIC_TYPE_EXPR is not an escape site, so i'm not sure
> > why you think this would work.
> 
> I'm not sure it will work either.  But the escape site was a trick to say 
> "past this point, we cannot track the SMT of variables anymore because the 
> pointer is T_R_C_A_A".  I've not looked at the CHANGE_DYNAMIC_TYPE_EXPR patch 
> in details, but I'm under the impression that we would be able to track them.

What does TYPE_REF_CAN_ALIAS_ALL mean, exactly?  Right now it is
implemented to mean that a pointer with that type can point to
anything whatsoever.  That is not what CHANGE_DYNAMIC_TYPE_EXPR means
in my patch.  CHANGE_DYNAMIC_TYPE_EXPR means that a specific pointer
can point to a value of any type.

Those are rather different concepts.  One of the basic things which
alias analysis attempts to determine is whether, given a pointer P and
a variable V, P could point to V.  The alias analysis solver code
tries to determine this by looking at where V's address was taken and
what was done with it.  If it can't find any other reason to decide,
it makes a final attempt by using TBAA to check whether the type of *P
is compatible with V.  CHANGE_DYNAMIC_TYPE_EXPR disables that last
step.

TYPE_REF_CAN_ALIAS_ALL disables the whole analysis.  That is, if P has
a type with TYPE_REF_CAN_ALIAS_ALL, then the alias analysis code
assumes that P could point to V, even if it can't see any way that the
address of V could have wound up in the variable P.

If the meaning of TYPE_REF_CAN_ALIAS_ALL is intended to be more like
what CHANGE_DYNAMIC_TYPE_EXPR does, then with my patch that is easy to
implement: remove the uses of PTR_IS_REF_ALL from tree-ssa-alias.c,
and change new_var_info in tree-ssa-structalias.c to set
no_tbaa_pruning if TYPE_REF_CAN_ALIAS_ALL.  I hope you have some test
cases for it.

Ian


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