https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94671
--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Richard Biener from comment #3) > The question is whether the standard allows eliding of the side-effect > setting newCalled to true. It does. That side effect happens inside a replaceable global allocation function. The compiler is allowed to optimise away calls to replaceable global allocation functions.