aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dce.c
diff options
context:
space:
mode:
authorTom de Vries <tom@codesourcery.com>2011-10-18 08:57:39 +0000
committerTom de Vries <vries@gcc.gnu.org>2011-10-18 08:57:39 +0000
commit266fbb797168bffea7bf23c20c2a5562d73bb8ca (patch)
tree3b1b6394f8dab21f1dae90612735039580316aaf /gcc/tree-ssa-dce.c
parentcab35794426a18f99a26d47b2c94546569cfacc1 (diff)
downloadgcc-266fbb797168bffea7bf23c20c2a5562d73bb8ca.zip
gcc-266fbb797168bffea7bf23c20c2a5562d73bb8ca.tar.gz
gcc-266fbb797168bffea7bf23c20c2a5562d73bb8ca.tar.bz2
re PR tree-optimization/50672 (ice: verify_ssa failed: no immediate_use list)
2011-10-18 Tom de Vries <tom@codesourcery.com> PR tree-optimization/50672 * tree-ssa-dce.c (mark_virtual_operand_for_renaming): New function, factored out of ... (mark_virtual_phi_result_for_renaming): Use mark_virtual_operand_for_renaming. * tree-flow.h (mark_virtual_operand_for_renaming): Declare. * tree-ssa-tail-merge.c (release_last_vdef): New function. (purge_bbs): Add update_vops parameter. Call release_last_vdef for each deleted basic block. (tail_merge_optimize): Add argument to call to purge_bbs. From-SVN: r180126
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r--gcc/tree-ssa-dce.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index b84b6f9..5a6a38e 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -982,18 +982,36 @@ propagate_necessity (struct edge_list *el)
}
}
-/* Replace all uses of result of PHI by underlying variable and mark it
+/* Replace all uses of NAME by underlying variable and mark it
for renaming. */
void
-mark_virtual_phi_result_for_renaming (gimple phi)
+mark_virtual_operand_for_renaming (tree name)
{
bool used = false;
imm_use_iterator iter;
use_operand_p use_p;
gimple stmt;
- tree result_ssa, result_var;
+ tree name_var;
+
+ name_var = SSA_NAME_VAR (name);
+ FOR_EACH_IMM_USE_STMT (stmt, iter, name)
+ {
+ FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
+ SET_USE (use_p, name_var);
+ update_stmt (stmt);
+ used = true;
+ }
+ if (used)
+ mark_sym_for_renaming (name_var);
+}
+/* Replace all uses of result of PHI by underlying variable and mark it
+ for renaming. */
+
+void
+mark_virtual_phi_result_for_renaming (gimple phi)
+{
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file, "Marking result for renaming : ");
@@ -1001,19 +1019,10 @@ mark_virtual_phi_result_for_renaming (gimple phi)
fprintf (dump_file, "\n");
}
- result_ssa = gimple_phi_result (phi);
- result_var = SSA_NAME_VAR (result_ssa);
- FOR_EACH_IMM_USE_STMT (stmt, iter, result_ssa)
- {
- FOR_EACH_IMM_USE_ON_STMT (use_p, iter)
- SET_USE (use_p, result_var);
- update_stmt (stmt);
- used = true;
- }
- if (used)
- mark_sym_for_renaming (result_var);
+ mark_virtual_operand_for_renaming (gimple_phi_result (phi));
}
+
/* Remove dead PHI nodes from block BB. */
static bool