summaryrefslogtreecommitdiff
path: root/gcc/cgraph.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-04 11:52:35 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-04 11:52:35 +0000
commit98107def4d92f0f02d34c53e5971c5e68176815a (patch)
tree5d195f2c96f8f418bd1d795709474cd7c6d0007d /gcc/cgraph.c
parent23913915572ebc3bee410dc2b1115199865f179e (diff)
downloadgcc-98107def4d92f0f02d34c53e5971c5e68176815a.tar.gz
2014-04-04 Richard Biener <rguenther@suse.de>
PR ipa/60746 * tree-ssanames.c (make_ssa_name_fn): Fix assert. * gimple.c (gimple_set_bb): Avoid ICEing for NULL cfun for non-GIMPLE_LABELs. * gimplify.h (gimple_add_tmp_var_fn): Declare. * gimplify.c (gimple_add_tmp_var_fn): New function. * gimple-expr.h (create_tmp_reg_fn): Declare. * gimple-expr.c (create_tmp_reg_fn): New function. * gimple-low.c (record_vars_into): Don't change cfun. * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Fix code generation without cfun. * g++.dg/torture/pr60746.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209079 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.c')
-rw-r--r--gcc/cgraph.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index dcab9848307..281ad6326b5 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1479,13 +1479,14 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
{
if (TREE_CODE (lhs) == SSA_NAME)
{
+ tree var = create_tmp_reg_fn (DECL_STRUCT_FUNCTION (e->caller->decl),
+ TREE_TYPE (lhs), NULL);
+ var = get_or_create_ssa_default_def
+ (DECL_STRUCT_FUNCTION (e->caller->decl), var);
+ gimple set_stmt = gimple_build_assign (lhs, var);
gsi = gsi_for_stmt (new_stmt);
-
- tree var = create_tmp_var (TREE_TYPE (lhs), NULL);
- tree def = get_or_create_ssa_default_def
- (DECL_STRUCT_FUNCTION (e->caller->decl), var);
- gimple set_stmt = gimple_build_assign (lhs, def);
- gsi_insert_before (&gsi, set_stmt, GSI_SAME_STMT);
+ gsi_insert_before_without_update (&gsi, set_stmt, GSI_SAME_STMT);
+ update_stmt_fn (DECL_STRUCT_FUNCTION (e->caller->decl), set_stmt);
}
gimple_call_set_lhs (new_stmt, NULL_TREE);
update_stmt_fn (DECL_STRUCT_FUNCTION (e->caller->decl), new_stmt);