From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5988638418AF; Tue, 7 Jun 2022 00:13:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5988638418AF From: "gman at chromium dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/105867] New: incorrect dangling-pointer warning Date: Tue, 07 Jun 2022 00:13:59 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: gman at chromium dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: 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: Tue, 07 Jun 2022 00:13:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105867 Bug ID: 105867 Summary: incorrect dangling-pointer warning Product: gcc Version: 12.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: gman at chromium dot org Target Milestone: --- Created attachment 53094 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D53094&action=3Dedit dangling-pointer warning repo This code (attached) could be doing something wrong but I was asked to look into why this code gets an dangling-pointer warning in gcc 12.1 and after looking though it it seems like maybe the code is fine and the warning is incorrect? compiled with=20 -std=3Dc++17 -Wall -Wextra -pedantic-errors -Wdangling-pointer -O2 note that there is a function, TIntermRebuild::printStack, which is called = in several places. It's inclusion doesn't seem like it should affect the warni= ng. As it is it is compiled out via a macro #define printStack(msg) compiling it back in (delete the line above) makes the warning go away.=