This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
pretty-ipa merge 13: split_critical_edges hack WRT EH edges
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, rguenther at suse dot de
- Date: Fri, 24 Apr 2009 17:15:16 +0200
- Subject: pretty-ipa merge 13: split_critical_edges hack WRT EH edges
Hi,
this patch makes PRE happy with EH edges, the problem is described in
comment bellow.
Bootstrapped/regtested x86_64-linux. OK?
Honza
* tree-cfg.c (split_critical_edges): Split also edges where we can't
insert code even if they are not critical.
*** /aux/hubicka/trunk-write/gcc/tree-cfg.c Wed Apr 22 15:38:19 2009
--- tree-cfg.c Sat Apr 18 17:56:15 2009
*************** split_critical_edges (void)
*** 6992,7001 ****
FOR_ALL_BB (bb)
{
FOR_EACH_EDGE (e, ei, bb->succs)
! if (EDGE_CRITICAL_P (e) && !(e->flags & EDGE_ABNORMAL))
! {
split_edge (e);
! }
}
end_recording_case_labels ();
return 0;
--- 7009,7039 ----
FOR_ALL_BB (bb)
{
FOR_EACH_EDGE (e, ei, bb->succs)
! {
! if (EDGE_CRITICAL_P (e) && !(e->flags & EDGE_ABNORMAL))
split_edge (e);
! /* PRE inserts statements to edes and expect that
! since split_critical_edges was done beforehand, commiting edge
! insertions will not split more edges. In addition to critical
! edges we must split edges that has mulptiple succestors and
! ends by control flow statement, such as RESX.
! Go ahead and split them too. This match logic in
! gimple_find_edge_insert_loc. */
! else if ((!single_pred_p (e->dest)
! || phi_nodes (e->dest)
! || e->dest == EXIT_BLOCK_PTR)
! && e->src != ENTRY_BLOCK_PTR
! && !(e->flags & EDGE_ABNORMAL))
! {
! gimple_stmt_iterator gsi;
!
! gsi = gsi_last_bb (e->src);
! if (!gsi_end_p (gsi)
! && stmt_ends_bb_p (gsi_stmt (gsi))
! && gimple_code (gsi_stmt (gsi)) != GIMPLE_RETURN)
! split_edge (e);
! }
! }
}
end_recording_case_labels ();
return 0;