https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87096
--- Comment #4 from Rich Felker <bugdal at aerifal dot cx> --- I'm aware, but that makes it an invalid transformation. To be valid, the transformation must only be performed in cases where it's provably not exceptional. The same principle applies to all the pathological results where p=malloc(SIZE_MAX);if(!p)...;free(p) is getting optimized out (breaking code that relies on "if malloc succeeds, pointer arithmetic in the allocated object is valid"). This kind of error is a high-level optimization strategy mistake in gcc that needs to be addressed and fixed.