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/59287] New: points-to analysis confused by union accesses Date: Mon, 25 Nov 2013 15:17:00 -0000 [thread overview] Message-ID: <bug-59287-4@http.gcc.gnu.org/bugzilla/> (raw) http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59287 Bug ID: 59287 Summary: points-to analysis confused by union accesses Product: gcc Version: 4.9.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: rguenth at gcc dot gnu.org static void get_constraint_for_component_ref (tree t, vec<ce_s> *results, bool address_p, bool lhs_p) { ... /* Handle type-punning through unions. If we are extracting a pointer from a union via a possibly type-punning access that pointer points to anything, similar to a conversion of an integer to a pointer. */ if (!lhs_p) { tree u; for (u = t; TREE_CODE (u) == COMPONENT_REF || TREE_CODE (u) == ARRAY_REF; u = TREE_OPERAND (u, 0)) if (TREE_CODE (u) == COMPONENT_REF && TREE_CODE (TREE_TYPE (TREE_OPERAND (u, 0))) == UNION_TYPE) { struct constraint_expr temp; temp.offset = 0; temp.var = anything_id; temp.type = ADDRESSOF; results->safe_push (temp); return; } } has the adverse affect that if you have code like foo (TREE_CODE (t)) then it makes ANYTHING escape ... which is the worst thing that can happen. The above shouldn't be necessary.
next reply other threads:[~2013-11-25 15:17 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2013-11-25 15:17 rguenth at gcc dot gnu.org [this message] 2013-11-26 9:04 ` [Bug tree-optimization/59287] " rguenth at gcc dot gnu.org 2013-11-26 9:05 ` 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-59287-4@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).