This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/49770] [4.7 Regression] wrong code with -fno-tree-forwprop
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 18 Jul 2011 10:47:19 +0000
- Subject: [Bug tree-optimization/49770] [4.7 Regression] wrong code with -fno-tree-forwprop
- Auto-submitted: auto-generated
- References: <bug-49770-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49770
--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-18 10:46:28 UTC ---
Ok, it's sth I worried about when doing the patch. Namely:
/* Make sure to use a valueized reference ... */
if (!ao_ref_init_from_vn_reference (&r, vr1.set, vr1.type, vr1.operands))
ao_ref_init (&r, op);
else
/* ... but also preserve a full reference tree for advanced TBAA. */
r.ref = op;
preserving op as r.ref is playing foul of the aliasing code which assumes
that the base in r.ref is the one that corresponds to the r.base, r.offset
pair. That is not the case when we valueized &MEM[&b]._M_finish into
MEM[D.1719_29]._M_cur.
Not doing the above loses some TBAA related disambiguations.
I'm thinking about a good solution.