aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-sra.c
diff options
context:
space:
mode:
authorMartin Jambor <mjambor@suse.cz>2010-06-28 18:47:55 +0200
committerMartin Jambor <jamborm@gcc.gnu.org>2010-06-28 18:47:55 +0200
commitbb8e5dcaa4c07a9aece8b608242d0c0b8d061eba (patch)
tree7f5474e587011fe850696418c42a153f09e865dd /gcc/tree-sra.c
parentf5d3b85519066d84021a53e00dffaa71754b893c (diff)
downloadgcc-bb8e5dcaa4c07a9aece8b608242d0c0b8d061eba.zip
gcc-bb8e5dcaa4c07a9aece8b608242d0c0b8d061eba.tar.gz
gcc-bb8e5dcaa4c07a9aece8b608242d0c0b8d061eba.tar.bz2
tree-sra.c (convert_callers): New parameter, change fndecls of recursive calls.
2010-06-26 Martin Jambor <mjambor@suse.cz> * tree-sra.c (convert_callers): New parameter, change fndecls of recursive calls. (modify_function): Pass the old decl to convert_callers. * testsuite/gcc.dg/ipa/ipa-sra-6.c: New test. From-SVN: r161503
Diffstat (limited to 'gcc/tree-sra.c')
-rw-r--r--gcc/tree-sra.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c
index 47d0e50..84d950f 100644
--- a/gcc/tree-sra.c
+++ b/gcc/tree-sra.c
@@ -4167,7 +4167,8 @@ all_callers_have_enough_arguments_p (struct cgraph_node *node)
/* Convert all callers of NODE to pass parameters as given in ADJUSTMENTS. */
static void
-convert_callers (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
+convert_callers (struct cgraph_node *node, tree old_decl,
+ ipa_parm_adjustment_vec adjustments)
{
tree old_cur_fndecl = current_function_decl;
struct cgraph_edge *cs;
@@ -4214,10 +4215,11 @@ convert_callers (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
if (gimple_code (stmt) != GIMPLE_CALL)
continue;
call_fndecl = gimple_call_fndecl (stmt);
- if (call_fndecl && cgraph_get_node (call_fndecl) == node)
+ if (call_fndecl == old_decl)
{
if (dump_file)
fprintf (dump_file, "Adjusting recursive call");
+ gimple_call_set_fndecl (stmt, node->decl);
ipa_modify_call_arguments (NULL, stmt, adjustments);
}
}
@@ -4256,7 +4258,7 @@ modify_function (struct cgraph_node *node, ipa_parm_adjustment_vec adjustments)
ipa_modify_formal_parameters (current_function_decl, adjustments, "ISRA");
ipa_sra_modify_function_body (adjustments);
sra_ipa_reset_debug_stmts (adjustments);
- convert_callers (new_node, adjustments);
+ convert_callers (new_node, node->decl, adjustments);
cgraph_make_node_local (new_node);
return;
}