public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/38895] New: missed type-based disambiguation Date: Sat, 17 Jan 2009 12:55:00 -0000 [thread overview] Message-ID: <bug-38895-10053@http.gcc.gnu.org/bugzilla/> (raw) RTL alias analysis (nonoverlapping_component_refs_p) with a quadratic loop finds that c->a1.i and b->a1.j cannot alias based on a offset test on the common sub-reference base a1. The tree based alias oracle only does two linear searches for the base type *c in b->a1.j and for *b in c->a1.i. This is related to PR13146 where even that is not enough, but a (non-conservative?) answer based on not finding a common base needs to be given. /* { dg-do compile } */ /* { dg-options "-O -fstrict-aliasing -fdump-tree-optimized" } */ struct A { int i; int j; }; struct B { struct A a1; struct A a2; }; struct C { struct A a1; struct B b; }; int foo(struct C *c, struct B *b) { c->a1.i = 1; b->a1.j = 0; return c->a1.i; } /* { dg-final { scan-tree-dump "return 1;" "optimized" } } */ /* { dg-final { cleanup-tree-dump "optimized" } } */ -- Summary: missed type-based disambiguation Product: gcc Version: 4.4.0 Status: UNCONFIRMED Keywords: missed-optimization, alias, TREE Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38895
next reply other threads:[~2009-01-17 12:55 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-01-17 12:55 rguenth at gcc dot gnu dot org [this message] 2009-01-17 13:58 ` [Bug tree-optimization/38895] " rguenth at gcc dot gnu dot org 2009-01-17 16:03 ` rguenth at gcc dot gnu dot org 2009-04-03 10:29 ` rguenth at gcc dot gnu dot org 2009-04-03 10:36 ` rguenth at gcc dot gnu dot 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-38895-10053@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).