Commit 16917761 by Richard Biener Committed by Richard Biener

tree-inline.c (remap_gimple_stmt): Do not assing a BLOCK to a stmt that didn't have one.

2013-01-28  Richard Biener  <rguenther@suse.de>

	* tree-inline.c (remap_gimple_stmt): Do not assing a BLOCK
	to a stmt that didn't have one.
	(copy_phis_for_bb): Likewise for PHI arguments.
	(copy_debug_stmt): Likewise for debug stmts.

From-SVN: r195509
parent b9fc0497
2013-01-28 Richard Biener <rguenther@suse.de> 2013-01-28 Richard Biener <rguenther@suse.de>
* tree-inline.c (remap_gimple_stmt): Do not assing a BLOCK
to a stmt that didn't have one.
(copy_phis_for_bb): Likewise for PHI arguments.
(copy_debug_stmt): Likewise for debug stmts.
2013-01-28 Richard Biener <rguenther@suse.de>
PR tree-optimization/56034 PR tree-optimization/56034
* tree-loop-distribution.c (enum partition_kind): Add * tree-loop-distribution.c (enum partition_kind): Add
PKIND_REDUCTION. PKIND_REDUCTION.
......
...@@ -1198,7 +1198,6 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) ...@@ -1198,7 +1198,6 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
{ {
gimple copy = NULL; gimple copy = NULL;
struct walk_stmt_info wi; struct walk_stmt_info wi;
tree new_block;
bool skip_first = false; bool skip_first = false;
/* Begin by recognizing trees that we'll completely rewrite for the /* Begin by recognizing trees that we'll completely rewrite for the
...@@ -1458,19 +1457,15 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id) ...@@ -1458,19 +1457,15 @@ remap_gimple_stmt (gimple stmt, copy_body_data *id)
} }
/* If STMT has a block defined, map it to the newly constructed /* If STMT has a block defined, map it to the newly constructed
block. When inlining we want statements without a block to block. */
appear in the block of the function call. */
new_block = id->block;
if (gimple_block (copy)) if (gimple_block (copy))
{ {
tree *n; tree *n;
n = (tree *) pointer_map_contains (id->decl_map, gimple_block (copy)); n = (tree *) pointer_map_contains (id->decl_map, gimple_block (copy));
gcc_assert (n); gcc_assert (n);
new_block = *n; gimple_set_block (copy, *n);
} }
gimple_set_block (copy, new_block);
if (gimple_debug_bind_p (copy) || gimple_debug_source_bind_p (copy)) if (gimple_debug_bind_p (copy) || gimple_debug_source_bind_p (copy))
return copy; return copy;
...@@ -1987,7 +1982,6 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id) ...@@ -1987,7 +1982,6 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
edge old_edge = find_edge ((basic_block) new_edge->src->aux, bb); edge old_edge = find_edge ((basic_block) new_edge->src->aux, bb);
tree arg; tree arg;
tree new_arg; tree new_arg;
tree block = id->block;
edge_iterator ei2; edge_iterator ei2;
location_t locus; location_t locus;
...@@ -2015,19 +2009,18 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id) ...@@ -2015,19 +2009,18 @@ copy_phis_for_bb (basic_block bb, copy_body_data *id)
inserted = true; inserted = true;
} }
locus = gimple_phi_arg_location_from_edge (phi, old_edge); locus = gimple_phi_arg_location_from_edge (phi, old_edge);
block = id->block;
if (LOCATION_BLOCK (locus)) if (LOCATION_BLOCK (locus))
{ {
tree *n; tree *n;
n = (tree *) pointer_map_contains (id->decl_map, n = (tree *) pointer_map_contains (id->decl_map,
LOCATION_BLOCK (locus)); LOCATION_BLOCK (locus));
gcc_assert (n); gcc_assert (n);
block = *n; locus = COMBINE_LOCATION_DATA (line_table, locus, *n);
} }
else
locus = LOCATION_LOCUS (locus);
add_phi_arg (new_phi, new_arg, new_edge, block ? add_phi_arg (new_phi, new_arg, new_edge, locus);
COMBINE_LOCATION_DATA (line_table, locus, block) :
LOCATION_LOCUS (locus));
} }
} }
} }
...@@ -2324,14 +2317,11 @@ copy_debug_stmt (gimple stmt, copy_body_data *id) ...@@ -2324,14 +2317,11 @@ copy_debug_stmt (gimple stmt, copy_body_data *id)
tree t, *n; tree t, *n;
struct walk_stmt_info wi; struct walk_stmt_info wi;
t = id->block;
if (gimple_block (stmt)) if (gimple_block (stmt))
{ {
n = (tree *) pointer_map_contains (id->decl_map, gimple_block (stmt)); n = (tree *) pointer_map_contains (id->decl_map, gimple_block (stmt));
if (n) gimple_set_block (stmt, n ? *n : id->block);
t = *n;
} }
gimple_set_block (stmt, t);
/* Remap all the operands in COPY. */ /* Remap all the operands in COPY. */
memset (&wi, 0, sizeof (wi)); memset (&wi, 0, sizeof (wi));
......
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