[Bug tree-optimization/108187] False positive -Wfree-nonheap-object on impossible path with -O1

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 21 18:05:40 GMT 2022


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

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Ilya Maximets from comment #3)
> 
> 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 ?

Yes the warning code only runs with optimization turned on ...


More information about the Gcc-bugs mailing list