https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71885
--- Comment #15 from hyc at symas dot com --- (In reply to Markus Trippelsdorf from comment #3) > See https://gcc.gnu.org/gcc-6/porting_to.html (More aggressive optimization > of -flifetime-dse). > > You're invoking undefined behavior; -flifetime-dse=1 is a workaround. "More aggressive optimization of -flifetime-dse The C++ compiler (with enabled -flifetime-dse) is more aggressive in dead-store elimination in situations where a memory store to a location precedes a constructor to the memory location." This bug report is talking about a store that occurs *during* the constructor. This does not *precede* the constructor.