Commit a9db10d4 by Richard Guenther Committed by Richard Biener

re PR tree-optimization/45709 (internal compiler error: in add_phi_arg, at tree-phinodes.c:395)

2010-09-18  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45709
	* tree-inline.c (copy_phis_for_bb): Fixup new_edge when
	we splitted it.

	* g++.dg/torture/pr45709.C: New testcase.

From-SVN: r164390
parent 5d3b14bd
2010-09-18 Richard Guenther <rguenther@suse.de>
PR tree-optimization/45709
* tree-inline.c (copy_phis_for_bb): Fixup new_edge when
we splitted it.
2010-09-17 Sebastian Pop <sebastian.pop@amd.com> 2010-09-17 Sebastian Pop <sebastian.pop@amd.com>
* graphite-dependences.c (dot_deps): Add DEBUG_FUNCTION. * graphite-dependences.c (dot_deps): Add DEBUG_FUNCTION.
......
// { dg-do compile }
struct Region {
int storage[4];
int count;
};
static inline Region subtract(int lhs)
{
Region reg;
int* storage = reg.storage;
if (lhs > 0)
storage++;
reg.count = storage - reg.storage;
return reg;
}
void bar(int a)
{
const Region copyBack(subtract(a));
}
...@@ -2021,8 +2021,11 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id) ...@@ -2021,8 +2021,11 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
&& !is_gimple_val (new_arg)) && !is_gimple_val (new_arg))
{ {
gimple_seq stmts = NULL; gimple_seq stmts = NULL;
basic_block tem;
new_arg = force_gimple_operand (new_arg, &stmts, true, NULL); new_arg = force_gimple_operand (new_arg, &stmts, true, NULL);
gsi_insert_seq_on_edge_immediate (new_edge, stmts); tem = gsi_insert_seq_on_edge_immediate (new_edge, stmts);
if (tem)
new_edge = single_succ_edge (tem);
} }
add_phi_arg (new_phi, new_arg, new_edge, add_phi_arg (new_phi, new_arg, new_edge,
gimple_phi_arg_location_from_edge (phi, old_edge)); gimple_phi_arg_location_from_edge (phi, old_edge));
......
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