public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "msebor at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/104761] [12 Regression] False positive -Wdangling-pointer warning on NetworkManager since r12-6606 Date: Wed, 02 Mar 2022 20:35:12 +0000 [thread overview] Message-ID: <bug-104761-4-P04vZFdKuR@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-104761-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104761 Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Keywords| |diagnostic Blocks| |104077 --- Comment #3 from Martin Sebor <msebor at gcc dot gnu.org> --- That's right, the pass never calls mark_dfs_back_edges(). Thanks for the hint. A slightly simplified test case: $ cat pr104761.c && gcc -O1 -S -Wall -fdump-tree-waccess1=/dev/stdout pr104761.c typedef struct { int i; } S; void f (S **); void g (int); void test (int x) { S s = { 0 }; __attribute__((__cleanup__ (f))) S *p = 0; if (x) { g (s.i); for ( ; ; ); } } ;; Function test (test, funcdef_no=0, decl_uid=1986, cgraph_uid=1, symbol_order=0) pr104761.c: In function ‘test’: pr104761.c:15:8: warning: dangling pointer to ‘s’ may be used [-Wdangling-pointer=] 15 | g (s.i); | ^~~~~~~ pr104761.c:9:5: note: ‘s’ declared here 9 | S s = { 0 }; | ^ void test (int x) { struct S * p; struct S s; int _1; <bb 2> : s.i = 0; p = 0B; if (x_5(D) != 0) goto <bb 3>; [INV] else goto <bb 5>; [INV] <bb 3> : _1 = s.i; g (_1); <bb 4> : goto <bb 4>; [INV] <bb 5> : f (&p); s ={v} {CLOBBER(eol)}; p ={v} {CLOBBER(eol)}; return; } Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104077 [Bug 104077] bogus/missing -Wdangling-pointer
next prev parent reply other threads:[~2022-03-02 20:35 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-03-02 15:19 [Bug middle-end/104761] New: " jakub at gcc dot gnu.org 2022-03-02 15:19 ` [Bug middle-end/104761] " jakub at gcc dot gnu.org 2022-03-02 15:51 ` jakub at gcc dot gnu.org 2022-03-02 16:07 ` jakub at gcc dot gnu.org 2022-03-02 20:35 ` msebor at gcc dot gnu.org [this message] 2022-03-02 23:16 ` [Bug middle-end/104761] [12 Regression] bogus -Wdangling-pointer with cleanup and infinite loop msebor at gcc dot gnu.org 2022-03-03 21:02 ` cvs-commit at gcc dot gnu.org 2022-03-03 21:02 ` msebor at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-104761-4-P04vZFdKuR@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).