From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DEB0D3858C20; Wed, 30 Nov 2022 14:00:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEB0D3858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1669816848; bh=JD/m7vp/k6QNoDY36FmkxZTH/ufCgZe+z6acGpYuZ4A=; h=From:To:Subject:Date:In-Reply-To:References:From; b=oqR5gvzm0bAKZc9zuM+iEwq8jsow9RGTQrtQfo67bs39P2t1izLnz7N/oow4SKPkS uxsNzgDOCx+LYTm1VdCZrfpzDbKpbipLPXq9Kk95t7x9vIDdqujm+uS2IQBKQyD43r XOEERe81CauUPTgE1en92P2waYNE2RZcq+/6AQhQ= From: "rguenth at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.3 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D106434 --- Comment #6 from Richard Biener --- We diagnose MEM[(struct _Alloc_hider *)0B]._M_p =3D 16B; that's conditional on if (_178 =3D=3D 0B) so probably constant propagated f= rom that. That on the other hand is conditional on if (_178 !=3D _179) with _178 =3D unique.D.69649._M_impl.D.68955._M_finish; _179 =3D unique.D.69649._M_impl.D.68955._M_end_of_storage; from vector::insert: insert(iterator __position, const value_type& __x) #endif {=20 const size_type __n =3D __position - begin(); if (this->_M_impl._M_finish !=3D this->_M_impl._M_end_of_storage) if (__position =3D=3D end()) {=20 _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 =3D 0B; it seems. I'm a bit lost here.=