aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2021-04-28 09:34:03 +0200
committerRichard Biener <rguenther@suse.de>2021-04-29 08:32:14 +0200
commit8ddce3f7d0db060885df24e41dd289173ec774a0 (patch)
tree65945f43a32d51bc97ea8fef9dbadc188cb3bb95
parent2c8bffa184dffba7976ba807ef0a1bbb6f66aa2d (diff)
downloadgcc-8ddce3f7d0db060885df24e41dd289173ec774a0.zip
gcc-8ddce3f7d0db060885df24e41dd289173ec774a0.tar.gz
gcc-8ddce3f7d0db060885df24e41dd289173ec774a0.tar.bz2
ipa/100308 - properly update the callgraph when pruning EH in IPA CP
This makes sure to fall into the delete_unreachable_blocks_update_callgraph handling to remove blocks becoming unreachable when removing EH edges by tracking blocks to need EH cleanup and doing that after releasing dominance info. This fixes an ICE seen with gfortran.dg/gomp/pr88933.f90 when enhancing DSE. 2021-04-28 Richard Biener <rguenther@suse.de> PR ipa/100308 * ipa-prop.c (ipcp_modif_dom_walker::before_dom_children): Track blocks to cleanup EH in new m_need_eh_cleanup. (ipcp_modif_dom_walker::cleanup_eh): New. (ipcp_transform_function): Release dominator info before doing EH cleanup.
-rw-r--r--gcc/ipa-prop.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/gcc/ipa-prop.c b/gcc/ipa-prop.c
index 010c43f..02c483b 100644
--- a/gcc/ipa-prop.c
+++ b/gcc/ipa-prop.c
@@ -5514,17 +5514,20 @@ public:
ipcp_modif_dom_walker (struct ipa_func_body_info *fbi,
vec<ipa_param_descriptor, va_gc> *descs,
struct ipa_agg_replacement_value *av,
- bool *sc, bool *cc)
+ bool *sc)
: dom_walker (CDI_DOMINATORS), m_fbi (fbi), m_descriptors (descs),
- m_aggval (av), m_something_changed (sc), m_cfg_changed (cc) {}
+ m_aggval (av), m_something_changed (sc) {}
virtual edge before_dom_children (basic_block);
+ bool cleanup_eh ()
+ { return gimple_purge_all_dead_eh_edges (m_need_eh_cleanup); }
private:
struct ipa_func_body_info *m_fbi;
vec<ipa_param_descriptor, va_gc> *m_descriptors;
struct ipa_agg_replacement_value *m_aggval;
- bool *m_something_changed, *m_cfg_changed;
+ bool *m_something_changed;
+ auto_bitmap m_need_eh_cleanup;
};
edge
@@ -5616,9 +5619,8 @@ ipcp_modif_dom_walker::before_dom_children (basic_block bb)
}
*m_something_changed = true;
- if (maybe_clean_eh_stmt (stmt)
- && gimple_purge_dead_eh_edges (gimple_bb (stmt)))
- *m_cfg_changed = true;
+ if (maybe_clean_eh_stmt (stmt))
+ bitmap_set_bit (m_need_eh_cleanup, bb->index);
}
return NULL;
}
@@ -5876,7 +5878,7 @@ ipcp_transform_function (struct cgraph_node *node)
struct ipa_func_body_info fbi;
struct ipa_agg_replacement_value *aggval;
int param_count;
- bool cfg_changed = false, something_changed = false;
+ bool something_changed = false;
gcc_checking_assert (cfun);
gcc_checking_assert (current_function_decl);
@@ -5907,15 +5909,16 @@ ipcp_transform_function (struct cgraph_node *node)
vec_safe_grow_cleared (descriptors, param_count, true);
ipa_populate_param_decls (node, *descriptors);
calculate_dominance_info (CDI_DOMINATORS);
- ipcp_modif_dom_walker (&fbi, descriptors, aggval, &something_changed,
- &cfg_changed).walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
+ ipcp_modif_dom_walker walker (&fbi, descriptors, aggval, &something_changed);
+ walker.walk (ENTRY_BLOCK_PTR_FOR_FN (cfun));
+ free_dominance_info (CDI_DOMINATORS);
+ bool cfg_changed = walker.cleanup_eh ();
int i;
struct ipa_bb_info *bi;
FOR_EACH_VEC_ELT (fbi.bb_infos, i, bi)
free_ipa_bb_info (bi);
fbi.bb_infos.release ();
- free_dominance_info (CDI_DOMINATORS);
ipcp_transformation *s = ipcp_transformation_sum->get (node);
s->agg_values = NULL;