https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92559
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |missed-optimization Status|UNCONFIRMED |NEW Last reconfirmed| |2019-11-19 Ever confirmed|0 |1 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- We cannot currently deal with the intermediate stmts in bb 10 and maybe also not with the EH. I'm not sure whether in the middle-end we really will ever be able to elide the ctor/dtor of m around the recursive call. Using by-reference passing might be a way around this (I don't think the return of std::map is really the issue). *_20(D) = foo (&D.34875); [return slot optimization] ;; succ: 14 (EH,EXECUTABLE) ;; 10 (FALLTHRU,EXECUTABLE) <bb 10> : _40 = MEM[(struct _Rb_tree *)&D.34875]._M_impl.D.33073._M_header._M_parent; std::_Rb_tree<unsigned int, std::pair<const unsigned int, unsigned int>, std::_Select1st<std::pair<const unsigned int, unsigned int> >, std::less<unsigned int>, std::allocator<std::pair<const unsigned int, unsigned int> > >::_M_erase (&D.34875._M_t, _40); D.34875 ={v} {CLOBBER}; D.34875 ={v} {CLOBBER}; ;; succ: 11 (FALLTHRU,EXECUTABLE) <bb 11> : return _20(D);