https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95638
--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> --- (In reply to Martin Liška from comment #2) > The code works with -flifetime-dse=1, so I bet there's some object that goes > out of life: > https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html > https://gcc.gnu.org/gcc-6/porting_to.html#flifetime-dse The difference between -flifetime-dse=1 and the default is not in uses after end of scope, but in relying on content being defined across start of the constructor.