public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/106868] [12/13 Regression] Bogus -Wdangling-pointer warning with -O1 Date: Mon, 05 Dec 2022 09:41:49 +0000 [thread overview] Message-ID: <bug-106868-4-CQKzR1S6yb@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-106868-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106868 Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |rguenth at gcc dot gnu.org --- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> --- I'm testing a variant of the patch that instead makes the argument pass-through work the same as the PHI pass-through which instead does if (!m_ptr_qry.get_ref (arg, phi, &aref, 0) || (aref.deref == 0 && POINTER_TYPE_P (TREE_TYPE (aref.ref)))) continue; thus disallows aref.deref == 0 with pointer type which is what happens in this case as well. OTOH it doesn't make much sense to me either - but then the .get_ref documentation is very sparse and the API very complicated. I _think_ that the get_ref (via compute_objsize) returns the object that 'arg' references (points-to) in aref.ref, but how aref.deref is then set is a mystery to me. It _seems_ that we want to have < 0 here as martin indicated but that would mean the PHI case is wrong as well (and the POINTER_TYPE_P check very odd). It also seems that for the call case we might want to call check_dangling_uses (var, aref.ref, true) for aref.deref == 0? I'm going to test this piecewise.
next prev parent reply other threads:[~2022-12-05 9:41 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-09-07 8:47 [Bug c/106868] New: " medhefgo at web dot de 2022-09-07 9:05 ` [Bug tree-optimization/106868] [12/13 Regression] " rguenth at gcc dot gnu.org 2022-09-12 16:18 ` msebor at gcc dot gnu.org 2022-09-12 17:04 ` msebor at gcc dot gnu.org 2022-12-05 9:41 ` rguenth at gcc dot gnu.org [this message] 2022-12-05 13:56 ` cvs-commit at gcc dot gnu.org 2022-12-05 14:06 ` rguenth at gcc dot gnu.org 2022-12-12 11:20 ` [Bug tree-optimization/106868] [12 " cvs-commit at gcc dot gnu.org 2022-12-12 11:20 ` rguenth 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-106868-4-CQKzR1S6yb@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).