https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93156
--- Comment #5 from jim at meyering dot net --- (In reply to Andrew Pinski from comment #4) > (In reply to jim from comment #3) > > Hi Andrew, thank you for the prompt investigation. > > I'm probably just being dense, but how can the compiler ever generate code > > for that null_ptr function that results in -1? > > It is not that null_ptr can result in -1 directly but rather if it is > inlined and then later on passed to a non-null function, it will change it > to be the non-null case. Let me rephrase: how can a transformation that makes it look like null_ptr returned -1 be valid?