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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rguenth at gcc dot gnu.org

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> Before IPA we try to preserve the exact access path for
> __builtin_object_size reasons (except for bugs) but after IPA it is really
> solely about equivalent addresses.
> There were talks in other PRs about VN changing the access path on
> ADDR_EXPRs to something that could to some extent work in both, whether it
> is just MEM_REF of the base with offset or e.g. in this case to the anon
> union as something common between those, but nothing has been implemented
> and the question is how hard would it be to do so.

Doing it on-demand, aka only when VN figures a problematic equivalency is
difficult.  Doing it generally, like for example during laddress, will wreck
all those testcases Martin added ... doing it semi-on-demand, like only when
VN substitutes a SSA name for a constant address would be possible, but it
will miss _1 = &a[i_2]->a.b.c; vs. _3 = &a[i_2]->a.c.d; which is way more
ugly to handle (we'd have to rewrite the prevailing definition which we'd
not touch otherwise, only when there are going to be additional uses).

IMO the late diagnostic passes should be all moved, at least to before loop
optimizations (or laddress).

Reply via email to