mirror of git://gcc.gnu.org/git/gcc.git
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
This commit is contained in:
parent
a51e5fa2c2
commit
faaf273bb0
|
@ -1,3 +1,8 @@
|
||||||
|
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>
|
2012-04-20 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* config/rs6000/rs6000.c (rs6000_emit_savres_rtx): Formatting.
|
* config/rs6000/rs6000.c (rs6000_emit_savres_rtx): Formatting.
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
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>
|
2012-04-19 Steven Bosscher <steven@gcc.gnu.org>
|
||||||
|
|
||||||
* gcc.target/i386/pr45830.c: Update scan-tree-dump.
|
* gcc.target/i386/pr45830.c: Update scan-tree-dump.
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
// { 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)
|
else if (is_gimple_call (stmt)
|
||||||
&& gimple_call_lhs (stmt) != NULL_TREE)
|
&& gimple_call_lhs (stmt) != NULL_TREE)
|
||||||
{
|
{
|
||||||
gimple new_stmt;
|
|
||||||
|
|
||||||
tree expr = NULL_TREE;
|
tree expr = NULL_TREE;
|
||||||
|
bool res;
|
||||||
propagate_tree_value (&expr, val);
|
propagate_tree_value (&expr, val);
|
||||||
new_stmt = gimple_build_assign (gimple_call_lhs (stmt), expr);
|
res = update_call_from_tree (gsi, expr);
|
||||||
move_ssa_defining_stmt_for_defs (new_stmt, stmt);
|
gcc_assert (res);
|
||||||
gsi_replace (gsi, new_stmt, false);
|
|
||||||
}
|
}
|
||||||
else if (gimple_code (stmt) == GIMPLE_SWITCH)
|
else if (gimple_code (stmt) == GIMPLE_SWITCH)
|
||||||
propagate_tree_value (gimple_switch_index_ptr (stmt), val);
|
propagate_tree_value (gimple_switch_index_ptr (stmt), val);
|
||||||
|
|
Loading…
Reference in New Issue