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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot 
gnu.org

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
I'm testing a variant of the patch that instead makes the argument pass-through
work the same as the PHI pass-through which instead does

                 if (!m_ptr_qry.get_ref (arg, phi, &aref, 0)
                     || (aref.deref == 0
                         && POINTER_TYPE_P (TREE_TYPE (aref.ref))))
                   continue;

thus disallows aref.deref == 0 with pointer type which is what happens in
this case as well.

OTOH it doesn't make much sense to me either - but then the .get_ref
documentation is very sparse and the API very complicated.

I _think_ that the get_ref (via compute_objsize) returns the object
that 'arg' references (points-to) in aref.ref, but how aref.deref
is then set is a mystery to me.  It _seems_ that we want to have
< 0 here as martin indicated but that would mean the PHI case is
wrong as well (and the POINTER_TYPE_P check very odd).  It also
seems that for the call case we might want to call
check_dangling_uses (var, aref.ref, true) for aref.deref == 0?

I'm going to test this piecewise.

Reply via email to