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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #3 from Jeffrey A. Law <law at gcc dot gnu.org> ---
I think the minimized test is bogus.  Note:

struct vector : _Vector_base<_Tp, _Alloc> {
  typedef _Vector_base<_Tp, _Alloc> _Base;
  typedef _Base::pointer iterator;
  using _Base::_M_impl;
  vector();
  vector(vector &) { _M_impl._M_finish = 0; }
  __alloc_traits<typename _Base::_Tp_alloc_type>::reference back() {
    iterator __trans_tmp_5 = _M_impl._M_finish, __trans_tmp_2 = __trans_tmp_5;
    return *(__trans_tmp_2 - 1);
  }
};

Note the assignment to _M_impl._M_finish, which is then assigned to
__trans_tmp_5 which is then assigned to __trans_tmp_2 and then dereferenced.

That corresponds to this chunk of IL:

  last = MEM[(const struct tdr_t &)0B + 18446744073709551592];


That's going to trigger the out of bounds access warning, but I think it's
warranted in this case.

Reply via email to