[Bug libstdc++/102221] Missed optimizations for algorithms over std::unique_ptr
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Sep 8 20:21:34 GMT 2021
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102221
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #1)
> This comes from the construction of a local unique_ptr<int> variable in:
>
> template<typename _RandomAccessIterator, typename _Compare>
> _GLIBCXX20_CONSTEXPR
> void
> __unguarded_linear_insert(_RandomAccessIterator __last,
> _Compare __comp)
Actually, even if we eliminate the temporary here, there's another in the
__make_heap routine:
while (true)
{
_ValueType __value = _GLIBCXX_MOVE(*(__first + __parent));
std::__adjust_heap(__first, __parent, __len, _GLIBCXX_MOVE(__value),
__comp);
if (__parent == 0)
return;
__parent--;
}
More information about the Gcc-bugs
mailing list