PATCH RFA: PR 29286: Handle placement new aliasing issues

Eric Botcazou ebotcazou@adacore.com
Mon Jun 11 16:58:00 GMT 2007


> For every dereferenced pointer, we call get_smt_for.  For REF_ALL
> pointers, this always returns ref_all_symbol_mem_tag.  In
> finalize_ref_all_pointers, we make every call clobbered variable an
> alias for ref_all_symbol_mem_tag.  The effect is to say that any
> reference through a REF_ALL pointer can change any call clobbered
> variable.

But only if PTA fails, no?  In other words, if you can compute a NMT for a 
ref-all pointer, it will still be used instead of the special SMT.

> Still, you're right, I missed a subtlety.  If there is a set of
> variables which are not call clobbered, and whose address is never
> cast to a TYPE_REF_CAN_ALIAS_ALL type, then I think that REF_ALL
> pointers will never be considered as pointing to them.

Right, this is an optimization over the RTL side.

I now remember a little more: when we discussed internally what to do in order 
to support TYPE_REF_CAN_ALIAS_ALL in GCC 4.x, we first thought of making 
may_alias_p always return 1 for them.  But then I realized that an important 
case for Ada (Address_To_Access_Conversions) was already partially handled in
is_escape_site by

	  /* If the RHS is a conversion between a pointer and an integer, the
	     pointer escapes since we can't track the integer.  */
	  if (POINTER_TYPE_P (from) && !POINTER_TYPE_P (to))
	    return ESCAPE_BAD_CAST;

Hence the idea of handling the whole thing the same way.

-- 
Eric Botcazou



More information about the Gcc-patches mailing list