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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Note the example clearly violates C TBAA rules and the "optimization" of
eliding the data member(s) for 'head' are invalid.  It's not only about
diagnostics but about wrong-code generation waiting to happen (unless you use
-fno-strict-aliasing).

If you access only the list head part then use a pointer to list for the
access.
Note I don't see the actual bogus access (the accesses seem to be guarded
with &curr->list != &head) but the warning might be exposed by path isolating
of actually unreachable code.

Reply via email to