This fixes the FAIL of PR50058 - I tightened the struct copy matching too much and somehow the FAIL got lost during testing.
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2011-08-15 Richard Guenther <rguent...@suse.de> PR tree-optimization/50058 * tree-ssa-sccvn.c (vn_reference_lookup_3): Relax aggregate copy matching. Index: gcc/tree-ssa-sccvn.c =================================================================== *** gcc/tree-ssa-sccvn.c (revision 177757) --- gcc/tree-ssa-sccvn.c (working copy) *************** vn_reference_lookup_3 (ao_ref *ref, tree *** 1485,1496 **** may fail when comparing types for compatibility. But we really don't care here - further lookups with the rewritten operands will simply fail if we messed up types too badly. */ ! if (j == 0 && i == 0 && VEC_index (vn_reference_op_s, lhs_ops, 0)->opcode == MEM_REF ! && VEC_index (vn_reference_op_s, vr->operands, i)->opcode == MEM_REF ! && tree_int_cst_equal ! (VEC_index (vn_reference_op_s, lhs_ops, 0)->op0, ! VEC_index (vn_reference_op_s, vr->operands, i)->op0)) i--, j--; /* i now points to the first additional op. --- 1485,1495 ---- may fail when comparing types for compatibility. But we really don't care here - further lookups with the rewritten operands will simply fail if we messed up types too badly. */ ! if (j == 0 && i >= 0 && VEC_index (vn_reference_op_s, lhs_ops, 0)->opcode == MEM_REF ! && VEC_index (vn_reference_op_s, lhs_ops, 0)->off != -1 ! && (VEC_index (vn_reference_op_s, lhs_ops, 0)->off ! == VEC_index (vn_reference_op_s, vr->operands, i)->off)) i--, j--; /* i now points to the first additional op.