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

Dimitry Andric <dimitry at andric dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dimitry at andric dot com

--- Comment #4 from Dimitry Andric <dimitry at andric dot com> ---
(In reply to Jeffrey A. Law from comment #3)
> 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.

It could be that cvise messed this up while reducing, but the basic code came
straight out of libstdc++. So it's still a possible issue in libstdc++.

In any case, we're ignoring -Warray-bounds now since it gives too many false
positives.

Reply via email to