On Fri, May 17, 2013 at 02:46:56PM +0200, Richard Biener wrote: > > stmt_kills_ref_p_1 wants to compare MEM_REF offset but compares > the pointers instead (which are previously compared as equal). > This breaks my fix for PR57303. > > Fixed thus, applied as obvious. > > Richard. > > 2013-05-17 Richard Biener <rguent...@suse.de> > > * tree-ssa-alias.c (stmt_kills_ref_p_1): Properly compare > MEM_REF offsets.
Ugh, thanks. As the 0th operand was equal, tree_int_cst_equal used to return always 1 and thus the if condition was never true. > --- gcc/tree-ssa-alias.c (revision 199004) > +++ gcc/tree-ssa-alias.c (working copy) > @@ -2002,8 +2002,8 @@ stmt_kills_ref_p_1 (gimple stmt, ao_ref > if (TREE_CODE (base) == MEM_REF && TREE_CODE (ref->base) == MEM_REF > && TREE_OPERAND (base, 0) == TREE_OPERAND (ref->base, 0)) > { > - if (!tree_int_cst_equal (TREE_OPERAND (base, 0), > - TREE_OPERAND (ref->base, 0))) > + if (!tree_int_cst_equal (TREE_OPERAND (base, 1), > + TREE_OPERAND (ref->base, 1))) > { > double_int off1 = mem_ref_offset (base); > off1 = off1.lshift (BITS_PER_UNIT == 8 Jakub