From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 8A8E83954460; Mon, 3 May 2021 16:48:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8A8E83954460 From: "msebor at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100370] [11/12 Regression] Incorrect warning for placement new Date: Mon, 03 May 2021 16:48:57 +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: 11.1.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: msebor at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 11.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: blocked cf_reconfirmed_on cf_known_to_fail bug_status cc everconfirmed 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 May 2021 16:48:57 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100370 Martin Sebor changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |100399 Last reconfirmed| |2021-05-03 Known to fail| |11.1.0 Status|UNCONFIRMED |NEW CC| |msebor at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #1 from Martin Sebor --- Confirmed. The false positive here is the result of trying to avoid other false positives for unions and not considering that the pointer might point= to space that's larger than that. Like the false negative in pr100307 comment= 2 (AKA pr100325), this would also be prevented by running -Wplacement-new lat= er, when the program is in SSA form, rather than from the front end. if (code =3D=3D COMPONENT_REF) { tree ref =3D TREE_OPERAND (ptr, 0); if (TREE_CODE (TREE_TYPE (ref)) =3D=3D UNION_TYPE) /* In accesses through union types consider the entire unions rather than just their members. */ ostype =3D 0; Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100399 [Bug 100399] bogus/missing -Wplacement-new=