From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B96C53858C66; Thu, 12 Jan 2023 09:43:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B96C53858C66 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673516638; bh=PnU1YlQuyhxlHgyxsXZvw/unAiX4NtKN3K2sy7831NA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=xMkk9YMMe8D6nrtu6tyh/NnwUC+OfdqDe41E/QeA3xWjCWUyLm6Ry8DsLyHe0kCZb ZOsXPVligBAWio+whXzumcX0xZ6vUO3VOct88J+TMtR/3TuMDSIWuHe6h+cO7XDNW+ YeJhjt82IRwLEVub/VIcS9H7lSzA4dIpBE/3rEh8= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108374] [12/13 Regression] unexpected -Wstringop-overflow when using std::atomic and std::shared_ptr Date: Thu, 12 Jan 2023 09:43:57 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 12.2.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: keywords bug_status priority target_milestone cf_reconfirmed_on everconfirmed version 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=3D108374 Richard Biener changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |NEW Priority|P3 |P2 Target Milestone|--- |12.3 Last reconfirmed| |2023-01-12 Ever confirmed|0 |1 Version|unknown |12.2.0 --- Comment #2 from Richard Biener --- We now say cc1plus: note: destination object is likely at address zero [local count: 1073741824]: _9 =3D MEM[(const struct __shared_ptr &)pointer_2(D)]._M_ptr; _10 =3D MEM[(const struct __shared_count &)pointer_2(D) + 8]._M_pi; if (_10 !=3D 0B) goto ; [53.47%] else goto ; [46.53%] [local count: 499612072]: __atomic_load_8 (16B, 5); [tail call] D.37576 =3D{v} {CLOBBER}; D.37576 =3D{v} {CLOBBER(eol)}; goto ; [100.00%] (leads straight to return) so we have __shared_count of pointer _M_pi =3D=3D 0 here, whatever that mea= ns and not sure why we atomically load here. Confirmed.=