https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87445
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Martin Sebor <msebor at gcc dot gnu.org> --- Never mind, I keep forgetting that GCC assumes that in the p->p case the nonnull function can clobber the value of the first p. Adding attribute pure to the called function lets it optimize the check away.