https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103984
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> --- (In reply to Jason Merrill from comment #5) > It is surprising that we warn with a user-provided copy constructor and > don't with a defaulted constructor. It changes the code a bit because it > means string_piece isn't trivially copyable, so we need to create a > string_piece temporary for passing to to_stage instead of passing arg > directly by bitwise copy, but I don't know why that would confuse the > optimizers into thinking that _M_p might be uninitialized. The diff of the GIMPLE is @@ -40,10 +39,7 @@ D$ = 1; try { - string_piece::string_piece (&D$, &arg); - try - { - _2 = to_stage (&D$); + _2 = to_stage (arg); D$.stage = _2; D$ = 0; try @@ -62,11 +58,6 @@ D$ = {CLOBBER}; } } - finally - { - D$ = {CLOBBER}; - } - } catch { if (D$ != 0) goto <D$>; else goto <D$>;