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

--- Comment #3 from Ilya Maximets <i.maximets at ovn dot org> ---
(In reply to Ilya Maximets from comment #2)
> (In reply to Richard Biener from comment #1)
> > Well, between the store to ->source and the read from it is the call
> > to dp_packet_use_afxdp which gets &xpacket->packet as argument and thus
> > needs to be treated as clobbering ->source.  So GCC can indeed not know
> > that ->source is DPBUF_AFXDP since the path is not provable impossible.
> > dp_packet_use_afxdp doesn't even get a const struct dp_packet * argument
> > (not that this would semantically change things in C).
> 
> Hmm, dp_packet_use_afxdp() is the function that sets source to DPBUF_AFXDP
> and initializes other parts of the structure.  So, it cannot take a const
> argument.  If GCC just doesn't look inside the dp_packet_use_afxdp() function
> at all here, then it will indeed not know that the source is DPBUF_AFXDP now.

Clarification:  I realized that dp_packet_use_afxdp() is part of a different
translation unit, so GCC doesn't have a chance to know what this function is
doing, hence it doesn't know that source is DPBUF_AFXDP.  Though I don't know
how we can change that code to make GCC happy.  We'll likely end up just
disabling a warning.

> However, I'm not sure why the issue doesn't appear with -O0 then.

I'm still not sure why this is happening though.  Is there something
special about -O0 ?

Reply via email to