Commit faaf273b by Richard Guenther Committed by Richard Biener

tree-ssa-copy.c (propagate_tree_value_into_stmt): Use update_call_from_tree when…

tree-ssa-copy.c (propagate_tree_value_into_stmt): Use update_call_from_tree when propagating into a call.

2012-04-20  Richard Guenther  <rguenther@suse.de>

	* tree-ssa-copy.c (propagate_tree_value_into_stmt): Use
	update_call_from_tree when propagating into a call.

	* g++.dg/torture/20120420-1.C: New testcase.

From-SVN: r186622
parent a51e5fa2
2012-04-20 Richard Guenther <rguenther@suse.de>
* tree-ssa-copy.c (propagate_tree_value_into_stmt): Use
update_call_from_tree when propagating into a call.
2012-04-20 Alan Modra <amodra@gmail.com>
* config/rs6000/rs6000.c (rs6000_emit_savres_rtx): Formatting.
......
2012-04-20 Richard Guenther <rguenther@suse.de>
* g++.dg/torture/20120420-1.C: New testcase.
2012-04-19 Steven Bosscher <steven@gcc.gnu.org>
* gcc.target/i386/pr45830.c: Update scan-tree-dump.
......
// { dg-do compile }
int g, *gp[100];
struct V {
int* x;
int y;
};
void foo (V **p, V* end, int i)
{
*p = 0;
V* pp = *p;
int s = 100;
for (; pp < end; )
{
pp++;
(pp-1)->x = &g;
if (g)
{
if (g>10)
g++;
int *t = (int*) operator new (100);
(pp-1)->x = t;
}
else
s--;
gp[end-pp] = (pp-1)->x + s;
}
}
......@@ -257,13 +257,11 @@ propagate_tree_value_into_stmt (gimple_stmt_iterator *gsi, tree val)
else if (is_gimple_call (stmt)
&& gimple_call_lhs (stmt) != NULL_TREE)
{
gimple new_stmt;
tree expr = NULL_TREE;
bool res;
propagate_tree_value (&expr, val);
new_stmt = gimple_build_assign (gimple_call_lhs (stmt), expr);
move_ssa_defining_stmt_for_defs (new_stmt, stmt);
gsi_replace (gsi, new_stmt, false);
res = update_call_from_tree (gsi, expr);
gcc_assert (res);
}
else if (gimple_code (stmt) == GIMPLE_SWITCH)
propagate_tree_value (gimple_switch_index_ptr (stmt), val);
......
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