https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109353

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
So it seems to be

    _M_insert_aux(iterator __position, bool __x)
    {
      if (this->_M_impl._M_finish._M_p != this->_M_impl._M_end_addr())
        {
          std::copy_backward(__position, this->_M_impl._M_finish,
                             this->_M_impl._M_finish + 1);
          *__position = __x;
          ++this->_M_impl._M_finish;
        }
      else
        {
          const size_type __len =
            _M_check_len(size_type(1), "vector<bool>::_M_insert_aux");
          _Bit_pointer __q = this->_M_allocate(__len);
          iterator __start(std::__addressof(*__q), 0);
          iterator __i = _M_copy_aligned(begin(), __position, __start); // <--
          *__i++ = __x;

where the compiler fails to optimize the case of no existing allocation.
Since that's from the push_back () itself no caching of the null start
in libstdc++ is possible.

Disabling early threading avoids the diagnostic because we then inline
very differently, not exposing most of the above.

Reply via email to