diff options
Diffstat (limited to 'gcc/tree-dfa.c')
-rw-r--r-- | gcc/tree-dfa.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/gcc/tree-dfa.c b/gcc/tree-dfa.c index 9db0cbb243a..679ffef06aa 100644 --- a/gcc/tree-dfa.c +++ b/gcc/tree-dfa.c @@ -981,9 +981,7 @@ mark_new_vars_to_rename (tree stmt, bitmap vars_to_rename) v_may_defs_after = NUM_V_MAY_DEFS (STMT_V_MAY_DEF_OPS (stmt)); v_must_defs_after = NUM_V_MUST_DEFS (STMT_V_MUST_DEF_OPS (stmt)); - FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, - SSA_OP_VMAYDEF | SSA_OP_VUSE | SSA_OP_VMUSTDEF) - + FOR_EACH_SSA_TREE_OPERAND (val, stmt, iter, SSA_OP_ALL_OPERANDS) { if (DECL_P (val)) { @@ -1004,3 +1002,27 @@ mark_new_vars_to_rename (tree stmt, bitmap vars_to_rename) BITMAP_XFREE (vars_in_vops_to_rename); } + +/* Find all variables within the gimplified statement that were not previously + visible to the function and add them to the referenced variables list. */ + +static tree +find_new_referenced_vars_1 (tree *tp, int *walk_subtrees, + void *data ATTRIBUTE_UNUSED) +{ + tree t = *tp; + + if (TREE_CODE (t) == VAR_DECL && !var_ann (t)) + add_referenced_tmp_var (t); + + if (IS_TYPE_OR_DECL_P (t)) + *walk_subtrees = 0; + + return NULL; +} + +void +find_new_referenced_vars (tree *stmt_p) +{ + walk_tree (stmt_p, find_new_referenced_vars_1, NULL, NULL); +} |