Commit a811f7cb by Jan Hubicka Committed by Jan Hubicka

re PR tree-optimization/58294 (ice in update_ssa_across_abnormal_edges, at tree-inline.c:1892)

	PR middle-end/58294
	* value-prof.c (gimple_ic): Copy also abnormal edges.
	* g++.dg/torture/PR58294.C: New testcase.

From-SVN: r202389
parent dcad1dd3
2013-09-09 Jan Hubicka <jh@suse.cz>
PR middle-end/58294
* value-prof.c (gimple_ic): Copy also abnormal edges.
2013-09-09 Richard Sandiford <rdsandiford@googlemail.com> 2013-09-09 Richard Sandiford <rdsandiford@googlemail.com>
* asan.c (asan_shadow_cst): Use gen_int_mode. * asan.c (asan_shadow_cst): Use gen_int_mode.
......
2013-09-09 Jan Hubicka <jh@suse.cz>
PR middle-end/58294
* g++.dg/torture/PR58294.C: New testcase.
2013-09-08 Jeff Law <law@redhat.com> 2013-09-08 Jeff Law <law@redhat.com>
* gcc.c-torture/compile/pr58340.c: New test. * gcc.c-torture/compile/pr58340.c: New test.
......
// { dg-do compile }
struct A {
virtual ~A();
virtual void m_fn1() { delete this; }
void m_fn2() { m_fn1(); }
};
struct B {
A *pi_;
B() { pi_->m_fn2(); }
};
struct C {
B pn;
};
void _setjmp();
int png_decode() {
_setjmp();
C a;
return 0;
}
...@@ -1299,6 +1299,9 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call, ...@@ -1299,6 +1299,9 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
edge e_cd, e_ci, e_di, e_dj = NULL, e_ij; edge e_cd, e_ci, e_di, e_dj = NULL, e_ij;
gimple_stmt_iterator gsi; gimple_stmt_iterator gsi;
int lp_nr, dflags; int lp_nr, dflags;
edge e_eh, e;
edge_iterator ei;
gimple_stmt_iterator psi;
cond_bb = gimple_bb (icall_stmt); cond_bb = gimple_bb (icall_stmt);
gsi = gsi_for_stmt (icall_stmt); gsi = gsi_for_stmt (icall_stmt);
...@@ -1401,24 +1404,21 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call, ...@@ -1401,24 +1404,21 @@ gimple_ic (gimple icall_stmt, struct cgraph_node *direct_call,
lp_nr = lookup_stmt_eh_lp (icall_stmt); lp_nr = lookup_stmt_eh_lp (icall_stmt);
if (lp_nr > 0 && stmt_could_throw_p (dcall_stmt)) if (lp_nr > 0 && stmt_could_throw_p (dcall_stmt))
{ {
edge e_eh, e;
edge_iterator ei;
gimple_stmt_iterator psi;
add_stmt_to_eh_lp (dcall_stmt, lp_nr); add_stmt_to_eh_lp (dcall_stmt, lp_nr);
FOR_EACH_EDGE (e_eh, ei, icall_bb->succs)
if (e_eh->flags & EDGE_EH)
break;
e = make_edge (dcall_bb, e_eh->dest, EDGE_EH);
for (psi = gsi_start_phis (e_eh->dest);
!gsi_end_p (psi); gsi_next (&psi))
{
gimple phi = gsi_stmt (psi);
SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, e),
PHI_ARG_DEF_FROM_EDGE (phi, e_eh));
}
} }
FOR_EACH_EDGE (e_eh, ei, icall_bb->succs)
if (e_eh->flags & (EDGE_EH | EDGE_ABNORMAL))
{
e = make_edge (dcall_bb, e_eh->dest, e_eh->flags);
for (psi = gsi_start_phis (e_eh->dest);
!gsi_end_p (psi); gsi_next (&psi))
{
gimple phi = gsi_stmt (psi);
SET_USE (PHI_ARG_DEF_PTR_FROM_EDGE (phi, e),
PHI_ARG_DEF_FROM_EDGE (phi, e_eh));
}
}
return dcall_stmt; return dcall_stmt;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment