https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80519
--- Comment #4 from Eric Gallager <egall at gwmail dot gwu.edu> --- (In reply to Marc Glisse from comment #3) > A warning would be quite a different thing. You would want it in the > front-end, to detect when a user literally wrote if(p)free(p). What I am > interested in is an optimization that detects when, possibly after inlining > and other optimizations, a call to free ends up below a null check, which is > normal and should not cause a warning. > > Since the 2 are unlikely to share any code, I'd suggest filing a separate PR. OK, I opened PR80528 for the warning.