From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id DC15D394480A; Mon, 3 May 2021 14:27:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DC15D394480A From: "jochen447 at concept dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/93644] [10/11/12 Regression] spurious -Wreturn-local-addr with PHI of PHI Date: Mon, 03 May 2021 14:27:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 10.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: jochen447 at concept dot de X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: jeffreyalaw at gmail dot com X-Bugzilla-Target-Milestone: 11.2 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc attachments.created 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 14:27:59 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93644 Jochen Roemmler changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jochen447 at concept dot de --- Comment #16 from Jochen Roemmler --- Created attachment 50739 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50739&action=3Dedit another minimal example to demonstrate the false alarm This is another instance of the test case. A senseless, yet perfectly valid piece of C code. It creates the false positive warning if compiled like thi= s: gcc -Wreturn-local-addr -O1 -fisolate-erroneous-paths-dereference -c pr93644_2.c pr93644_2.c: In function =E2=80=98buildVname=E2=80=99: pr93644_2.c:28:12: warning: function may return address of local variable [-Wreturn-local-addr] 28 | return vname; | ^~~~~ pr93644_2.c:18:17: note: declared here 18 | char buf[256]; | ^~~ I'm using gcc version 11.1.1 20210428 (Red Hat 11.1.1-1) (GCC)=20 However, I can silence the warning using # pragma GCC diagnostic ignored "-Wreturn-local-addr"=