https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107264
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Last reconfirmed| |2022-10-14 Component|c++ |middle-end Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- AT -O0 the IR is: _1 = std::_Rb_tree_iterator<std::pair<int* const, Opaque*> >::operator-> (&itr); _13 = &_1->second; if (_13 != 0B) goto <bb 4>; [INV] else goto <bb 5>; [INV] <bb 4> : *_13 ={v} {CLOBBER}; operator delete (_13, 8); While at -O1: _6 = &MEM[(struct pair *)itr$_M_node_18 + 32B].second; operator delete (_6, 8); I am shocked that didn't detect as a problem. Confirmed.