aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-05-04 13:39:14 +0200
committerRichard Biener <rguenther@suse.de>2021-05-04 15:51:05 +0200
commit7a3897661151cf8cc77d11f7a98fc64259210748 (patch)
tree20a29b0a23a85ce74dfeb9a8e251acea41f55fef /gcc/tree-ssa-phiopt.c
parent1580fc764423bf89e9b853aaa8c65999e37ccb8b (diff)
downloadgcc-7a3897661151cf8cc77d11f7a98fc64259210748.zip
gcc-7a3897661151cf8cc77d11f7a98fc64259210748.tar.gz
gcc-7a3897661151cf8cc77d11f7a98fc64259210748.tar.bz2
tree-optimization/100414 - compute dominance info in phiopt
phiopt now has dominator queries but fails to compute dominance info. 2021-05-04 Richard Biener <rguenther@suse.de> 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.
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c5
1 files changed, 2 insertions, 3 deletions
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<tree> *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<tree> *nontrap = new hash_set<tree>;
- /* 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);