diff options
author | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-07 03:25:29 +0000 |
---|---|---|
committer | dberlin <dberlin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-07-07 03:25:29 +0000 |
commit | 70ae6476fa55847f2c1422691a16c8d405efa002 (patch) | |
tree | 24aed28d0f9be6fc1f86cf8db9b21c0fc8d53291 /gcc/tree-ssa-sccvn.c | |
parent | e522c18562f73d74c629ae1ec391d9029f0c79eb (diff) | |
download | gcc-70ae6476fa55847f2c1422691a16c8d405efa002.tar.gz |
2007-07-06 Daniel Berlin <dberlin@dberlin.org>
Fix PR tree-optimization/23488
* tree-ssa-sccvn.c (expr_has_constants): Handle tcc_declaration.
(try_to_simplify): Ditto.
(visit_use): Ditto.
* tree-vn.c (set_value_handle): Use decl_vh_map for decl value
handles.
* tree-flow-inline.h (get_value_handle): Ditto.
* tree-ssa-pre.c (decl_vh_map): New.
(decl_node_pool): New.
(can_value_number_operation): Support DECL_P.
(can_PRE_operation): Ditto.
(create_expression_by_pieces): Ditto.
(find_existing_value_expr): Modify to differnetiate between
addressing and top level.
(create_value_handle_for_expr): Handle DECL's.
(poolify_tree): Ditto.
(make_values_for_phi): Don't insert into PHI_GEN during FRE.
(make_values_for_stmt): Handle DECL's properly.
(init_pre): Reorg to not init useless things during FRE.
(fini_pre): Ditto.
* tree-flow.h: Include pointer-set.h.
(decl_vh_map): Declare.
* Makefile.in (TREE_FLOW_H): Add pointer-set.h
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@126434 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-sccvn.c')
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index 9036e2ed6f9..651f747e479 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1332,6 +1332,7 @@ expr_has_constants (tree expr) /* Constants inside reference ops are rarely interesting, but it can take a lot of looking to find them. */ case tcc_reference: + case tcc_declaration: return false; default: return is_gimple_min_invariant (expr); @@ -1453,7 +1454,7 @@ try_to_simplify (tree stmt, tree rhs) { /* For references, see if we find a result for the lookup, and use it if we do. */ - + case tcc_declaration: case tcc_reference: { tree result = vn_reference_lookup (rhs, @@ -1613,7 +1614,7 @@ visit_use (tree use) if (TREE_CODE (lhs) == SSA_NAME && SSA_NAME_OCCURS_IN_ABNORMAL_PHI (lhs)) changed = defs_to_varying (stmt); - else if (REFERENCE_CLASS_P (lhs)) + else if (REFERENCE_CLASS_P (lhs) || DECL_P (lhs)) { changed = visit_reference_op_store (lhs, rhs, stmt); } |