[Bug tree-optimization/49770] [4.7 Regression] wrong code with -fno-tree-forwprop

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jul 18 10:48:00 GMT 2011


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.



More information about the Gcc-bugs mailing list