http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35290
Richard Guenther <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org |gnu.org | --- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2010-11-10 12:32:16 UTC --- Well, it's not working on the tree level to make it cheaper: /* We deliberately stop on clobbering statements and not only on killing ones to make walking cheaper. Otherwise we can just continue walking until both stores have equal reference trees. */ while (!stmt_may_clobber_ref_p (temp, gimple_assign_lhs (stmt))); changing that to while (!stmt_kills_ref_p (temp, gimple_assign_lhs (stmt))); will make it work (and slower). Also needs (possibly unsafe in general if used cross loop iteration) Index: gcc/tree-ssa-alias.c =================================================================== --- gcc/tree-ssa-alias.c (revision 166526) +++ gcc/tree-ssa-alias.c (working copy) @@ -1577,7 +1577,12 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref base = get_ref_base_and_extent (lhs, &offset, &size, &max_size); /* We can get MEM[symbol: sZ, index: D.8862_1] here, so base == ref->base does not always hold. */ - if (base == ref->base) + if (base == ref->base + || (TREE_CODE (base) == MEM_REF + && TREE_CODE (ref->base) == MEM_REF + && TREE_OPERAND (base, 0) == TREE_OPERAND (ref->base, 0) + && tree_int_cst_equal (TREE_OPERAND (base, 1), + TREE_OPERAND (ref->base, 1)))) { /* For a must-alias check we need to be able to constrain the accesses properly. */