https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109443

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |jason at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the middle-end could figure this out by itself, such PARM_DECLs or
RESULT_DECLs
are DECL_BY_REFERENCE and TREE_ADDRESSABLE (TREE_TYPE (TREE_TYPE
(parm_or_decl))).
I think that means that if one calls a function with two arguments the two
arguments won't alias:
struct S { S (); ~S (); S (const S &); int s; };
void
foo (S a, S b)
{
}
void
bar (S c)
{
  foo (c, c);
}
Inside of the function one can take address of such a parameter as many times
as one wants and dereference through that of course.  But I think one can
assume that when the
function is called, the argument (i.e. the address of the object in the caller)
isn't stored anywhere else.

Reply via email to