From 3bc27de7f15eb376eaff150d5f5f663bb06426d4 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 21 Jan 2011 14:02:41 +0000 Subject: re PR tree-optimization/47365 (wrong code with -O -ftree-pre) 2011-01-21 Richard Guenther PR tree-optimization/47365 * tree-ssa-sccvn.h (vn_lookup_kind): Declare. (vn_reference_lookup_pieces): Adjust. (vn_reference_lookup): Likewise. * tree-ssa-sccvn.c (vn_walk_kind): New static global. (vn_reference_lookup_3): Only look through kills if in VN_WALKREWRITE mode. (vn_reference_lookup_pieces): Adjust. (vn_reference_lookup): Likewise. (visit_reference_op_load): Likewise. (visit_reference_op_store): Likewise. * tree-ssa-pre.c (phi_translate_1): Use VN_WALK mode. (compute_avail): Likewise. (eliminate): Likewise. * gcc.dg/torture/pr47365.c: New testcase. * gcc.dg/tree-ssa/pr47392.c: Likewise. From-SVN: r169089 --- gcc/tree-ssa-sccvn.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gcc/tree-ssa-sccvn.h') diff --git a/gcc/tree-ssa-sccvn.h b/gcc/tree-ssa-sccvn.h index bd8b9bc..3d9ee5f 100644 --- a/gcc/tree-ssa-sccvn.h +++ b/gcc/tree-ssa-sccvn.h @@ -187,10 +187,11 @@ void copy_reference_ops_from_ref (tree, VEC(vn_reference_op_s, heap) **); void copy_reference_ops_from_call (gimple, VEC(vn_reference_op_s, heap) **); bool ao_ref_init_from_vn_reference (ao_ref *, alias_set_type, tree, VEC (vn_reference_op_s, heap) *); +typedef enum { VN_NOWALK, VN_WALK, VN_WALKREWRITE } vn_lookup_kind; tree vn_reference_lookup_pieces (tree, alias_set_type, tree, VEC (vn_reference_op_s, heap) *, - vn_reference_t *, bool); -tree vn_reference_lookup (tree, tree, bool, vn_reference_t *); + vn_reference_t *, vn_lookup_kind); +tree vn_reference_lookup (tree, tree, vn_lookup_kind, vn_reference_t *); vn_reference_t vn_reference_insert (tree, tree, tree); vn_reference_t vn_reference_insert_pieces (tree, alias_set_type, tree, VEC (vn_reference_op_s, heap) *, -- cgit v1.1