From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 4348C3972431; Thu, 26 Nov 2020 22:01:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4348C3972431 From: "eggert at cs dot ucla.edu" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/93644] [10/11 Regression] spurious -Wreturn-local-addr with PHI of PHI Date: Thu, 26 Nov 2020 22:01:40 +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: eggert at cs dot ucla.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: law at redhat dot com X-Bugzilla-Target-Milestone: 11.0 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 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: Thu, 26 Nov 2020 22:01:41 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D93644 --- Comment #10 from eggert at cs dot ucla.edu --- The generic workaround that Bruno describes ran into problems in Gnulib, as it's enabled only when compiled with -DGCC_LINT, and some users don't compi= le it that way. So we now have a more elaborate workaround: https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=3D5a8a1598e1243599f= eb302f0f75d947553f2918f that causes GCC to issue warnings like the following when the file is not compiled with -DGCC_LINT: careadlinkat.c:58:4: warning: #warning "GCC might issue a bogus -Wreturn-local-addr warning here." [-Wcpp] 58 | # warning "GCC might issue a bogus -Wreturn-local-addr warning her= e." | ^~~~~~~ careadlinkat.c:59:4: warning: #warning "See ." [-Wcpp] 59 | # warning "See ." | ^~~~~~~ careadlinkat.c: In function =E2=80=98careadlinkat=E2=80=99: careadlinkat.c:193:10: warning: function may return address of local variab= le [-Wreturn-local-addr] 193 | return readlink_stk (fd, filename, buffer, buffer_size, alloc, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 194 | preadlinkat, stack_buf); | ~~~~~~~~~~~~~~~~~~~~~~~ careadlinkat.c:192:8: note: declared here 192 | char stack_buf[STACK_BUF_SIZE]; | ^~~~~~~~~ but obviously this is awkward and it would be better if the bug were fixed.=