public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/106434] [12/13 Regression] Spurious -Wnull-dereference when using std::unique_copy() since r12-5187-g1ae8edf5f73ca5c3
Date: Wed, 30 Nov 2022 14:00:47 +0000	[thread overview]
Message-ID: <bug-106434-4-k63dYOT21z@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-106434-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
We diagnose

MEM[(struct _Alloc_hider *)0B]._M_p = 16B;

that's conditional on if (_178 == 0B) so probably constant propagated from
that.  That on the other hand is conditional on if (_178 != _179) with

_178 = unique.D.69649._M_impl.D.68955._M_finish;
_179 = unique.D.69649._M_impl.D.68955._M_end_of_storage;

from vector::insert:

    insert(iterator __position, const value_type& __x)
#endif
    { 
      const size_type __n = __position - begin();
      if (this->_M_impl._M_finish != this->_M_impl._M_end_of_storage)
        if (__position == end())
          { 
            _GLIBCXX_ASAN_ANNOTATE_GROW(1);
            _Alloc_traits::construct(this->_M_impl, this->_M_impl._M_finish,
                                     __x);
            ++this->_M_impl._M_finish;
            _GLIBCXX_ASAN_ANNOTATE_GREW(1);

for some reason __position is NULL here, from iin.iter._M_current = 0B; it
seems.

I'm a bit lost here.

  parent reply	other threads:[~2022-11-30 14:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-25 14:46 [Bug c++/106434] New: Spurious -Wnull-dereference when using std::unique_copy() vz-gcc at zeitlins dot org
2022-07-27  8:23 ` [Bug c++/106434] [12/13 Regression] Spurious -Wnull-dereference when using std::unique_copy() since r12-5187-g1ae8edf5f73ca5c3 marxin at gcc dot gnu.org
2022-08-12  6:59 ` rguenth at gcc dot gnu.org
2022-08-13  2:56 ` joshua.r.marshall.1991 at gmail dot com
2022-08-13  8:19 ` redi at gcc dot gnu.org
2022-08-13  8:25 ` redi at gcc dot gnu.org
2022-11-30 14:00 ` rguenth at gcc dot gnu.org [this message]
2022-11-30 14:06 ` rguenth at gcc dot gnu.org
2022-11-30 14:29 ` redi at gcc dot gnu.org
2022-11-30 14:36 ` redi at gcc dot gnu.org
2022-11-30 14:44 ` redi at gcc dot gnu.org
2022-12-06 21:36 ` cvs-commit at gcc dot gnu.org
2023-05-08 12:25 ` [Bug c++/106434] [12 " rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-106434-4-k63dYOT21z@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).