From 7a3897661151cf8cc77d11f7a98fc64259210748 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 4 May 2021 13:39:14 +0200 Subject: tree-optimization/100414 - compute dominance info in phiopt phiopt now has dominator queries but fails to compute dominance info. 2021-05-04 Richard Biener PR tree-optimization/100414 * tree-ssa-phiopt.c (get_non_trapping): Do not compute dominance info here. (tree_ssa_phiopt_worker): But unconditionally here. * gcc.dg/pr100414.c: New testcase. --- gcc/tree-ssa-phiopt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gcc/tree-ssa-phiopt.c') diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 35ce51e..5c18ea1 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -174,6 +174,8 @@ tree_ssa_phiopt_worker (bool do_store_elim, bool do_hoist_loads, bool early_p) bool cfgchanged = false; hash_set *nontrap = 0; + calculate_dominance_info (CDI_DOMINATORS); + if (do_store_elim) /* Calculate the set of non-trapping memory accesses. */ nontrap = get_non_trapping (); @@ -2438,9 +2440,6 @@ get_non_trapping (void) { nt_call_phase = 0; hash_set *nontrap = new hash_set; - /* We're going to do a dominator walk, so ensure that we have - dominance information. */ - calculate_dominance_info (CDI_DOMINATORS); nontrapping_dom_walker (CDI_DOMINATORS, nontrap) .walk (cfun->cfg->x_entry_block_ptr); -- cgit v1.1