diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-21 17:21:30 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-21 17:21:30 +0000 |
commit | 25dd612e84678972313516b9b935fa3959a2cd60 (patch) | |
tree | 24e4c33ad0ca5ee52147f1c54c49fc8e17575f21 /gcc/tree-ssa.c | |
parent | 054f015a946adc4e35050757613873fd8ed92178 (diff) | |
download | gcc-25dd612e84678972313516b9b935fa3959a2cd60.tar.gz |
2009-11-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 154407
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@154408 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa.c')
-rw-r--r-- | gcc/tree-ssa.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c index e6a9a07a5d8..4d0ccb066b1 100644 --- a/gcc/tree-ssa.c +++ b/gcc/tree-ssa.c @@ -279,7 +279,7 @@ find_released_ssa_name (tree *tp, int *walk_subtrees, void *data_) { struct walk_stmt_info *wi = (struct walk_stmt_info *) data_; - if (wi->is_lhs) + if (wi && wi->is_lhs) return NULL_TREE; if (TREE_CODE (*tp) == SSA_NAME) @@ -346,7 +346,13 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var) /* If we didn't get an insertion point, and the stmt has already been removed, we won't be able to insert the debug bind stmt, so we'll have to drop debug information. */ - if (is_gimple_assign (def_stmt)) + if (gimple_code (def_stmt) == GIMPLE_PHI) + { + value = degenerate_phi_result (def_stmt); + if (value && walk_tree (&value, find_released_ssa_name, NULL, NULL)) + value = NULL; + } + else if (is_gimple_assign (def_stmt)) { bool no_value = false; @@ -383,8 +389,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var) dead SSA NAMEs. SSA verification shall catch any errors. */ if ((!gsi && !gimple_bb (def_stmt)) - || !walk_gimple_op (def_stmt, find_released_ssa_name, - &wi)) + || walk_gimple_op (def_stmt, find_released_ssa_name, &wi)) no_value = true; } @@ -409,6 +414,7 @@ insert_debug_temp_for_var_def (gimple_stmt_iterator *gsi, tree var) at the expense of duplication of expressions. */ if (CONSTANT_CLASS_P (value) + || gimple_code (def_stmt) == GIMPLE_PHI || (usecount == 1 && (!gimple_assign_single_p (def_stmt) || is_gimple_min_invariant (value))) @@ -479,7 +485,7 @@ insert_debug_temps_for_defs (gimple_stmt_iterator *gsi) stmt = gsi_stmt (*gsi); - FOR_EACH_SSA_DEF_OPERAND (def_p, stmt, op_iter, SSA_OP_DEF) + FOR_EACH_PHI_OR_STMT_DEF (def_p, stmt, op_iter, SSA_OP_DEF) { tree var = DEF_FROM_PTR (def_p); |