[Bug tree-optimization/122380] [15/16 regression] std::variant with std::vectors of differing types may lead to double frees since r15-5595
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Mar 7 07:11:36 GMT 2026
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122380
--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
dse3 does:
```
Deleted dead store: # .MEM_58 = VDEF <.MEM_57>
MEM[(struct _Vector_impl_data *)m_3(D) + 8B]._M_end_of_storage = 0B;
Deleted dead store: # .MEM_57 = VDEF <.MEM_56>
MEM[(struct _Vector_impl_data *)m_3(D) + 8B]._M_finish = 0B;
Deleted dead store: # .MEM_56 = VDEF <.MEM_52>
MEM[(struct _Vector_impl_data *)m_3(D) + 8B]._M_start = 0B;
```
`-O2 -fno-tree-pre ` works.
More information about the Gcc-bugs
mailing list