diff options
author | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 21:45:56 +0000 |
---|---|---|
committer | dnovillo <dnovillo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-04-17 21:45:56 +0000 |
commit | 8e5b4ed6c154892fb2ef2619fff6b32445ca8ba6 (patch) | |
tree | 35617d27227f8f0332b1eb102297803c6dd769e5 /gcc/tree-dfa.c | |
parent | 132cae052ceb4556303898b4bfb854b6a4329e6b (diff) | |
download | gcc-8e5b4ed6c154892fb2ef2619fff6b32445ca8ba6.tar.gz |
* omp-low.c (create_omp_child_function): Set DECL_CONTEXT
for DECL.
* cgraphunit.c (cgraph_build_static_cdtor): Likewise.
* tree-dfa.c (find_referenced_vars_in): Factor out of ...
(find_vars_r): ... here.
* tree-flow.h (find_referenced_vars_in): Declare.
* tree-ssa-pre.c (create_expression_by_pieces): Assert
that AVAIL_OUT exists for BLOCK.
* Makefile.in (CGRAPH_H): Add dependency on cif-code.def
(tree-loop-distribution.o): Fix dependency on TREE_VECTORIZER_H.
(tree-parloops.o): Likewise.
testsuite/ChangeLog
* gcc.c-torture/execute/builtins/strlen-3.c: Fix ODR
violation for variable 'inside_main'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146295 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 1738dd01266..1bd54cd99a3 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -88,26 +88,10 @@ find_referenced_vars (void) FOR_EACH_BB (bb) { for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si)) - { - size_t i; - gimple stmt = gsi_stmt (si); - for (i = 0; i < gimple_num_ops (stmt); i++) - walk_tree (gimple_op_ptr (stmt, i), find_vars_r, NULL, NULL); - } + find_referenced_vars_in (gsi_stmt (si)); for (si = gsi_start_phis (bb); !gsi_end_p (si); gsi_next (&si)) - { - gimple phi = gsi_stmt (si); - size_t i, len = gimple_phi_num_args (phi); - - walk_tree (gimple_phi_result_ptr (phi), find_vars_r, NULL, NULL); - - for (i = 0; i < len; i++) - { - tree arg = gimple_phi_arg_def (phi, i); - walk_tree (&arg, find_vars_r, NULL, NULL); - } - } + find_referenced_vars_in (gsi_stmt (si)); } return 0; @@ -498,6 +482,33 @@ find_vars_r (tree *tp, int *walk_subtrees, void *data ATTRIBUTE_UNUSED) return NULL_TREE; } +/* Find referenced variables in STMT. In contrast with + find_new_referenced_vars, this function will not mark newly found + variables for renaming. */ + +void +find_referenced_vars_in (gimple stmt) +{ + size_t i; + + if (gimple_code (stmt) != GIMPLE_PHI) + { + for (i = 0; i < gimple_num_ops (stmt); i++) + walk_tree (gimple_op_ptr (stmt, i), find_vars_r, NULL, NULL); + } + else + { + walk_tree (gimple_phi_result_ptr (stmt), find_vars_r, NULL, NULL); + + for (i = 0; i < gimple_phi_num_args (stmt); i++) + { + tree arg = gimple_phi_arg_def (stmt, i); + walk_tree (&arg, find_vars_r, NULL, NULL); + } + } +} + + /* Lookup UID in the referenced_vars hashtable and return the associated variable. */ |