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.
(cherry picked from commit
7a3897661151cf8cc77d11f7a98fc64259210748)
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -fno-tree-dce -fno-tree-dse -fchecking" } */
+
+int i;
+void
+foo (void)
+{
+ i &= i && __builtin_bswap16 (i);
+}
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 ();
{
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);