aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2014-03-18 17:10:39 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2014-03-18 17:10:39 +0100
commiteb14a79f3588e22985d793cfd1eaf13eea1f955f (patch)
treea5a195673958851fe3a28cfc4409b5edcdf55e5e /gcc
parentbd10e887a5c484af6227758c1d210315905b51a0 (diff)
downloadgcc-eb14a79f3588e22985d793cfd1eaf13eea1f955f.zip
gcc-eb14a79f3588e22985d793cfd1eaf13eea1f955f.tar.gz
gcc-eb14a79f3588e22985d793cfd1eaf13eea1f955f.tar.bz2
cgraph.c (cgraph_update_edges_for_call_stmt_node): Added case when gimple call statement is update.
* cgraph.c (cgraph_update_edges_for_call_stmt_node): Added case when gimple call statement is update. * gimple-fold.c (gimple_fold_call): Changed order for GIMPLE_ASSIGN and GIMPLE_CALL, where gsi iterator still points to GIMPLE CALL. From-SVN: r208654
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/cgraph.c5
-rw-r--r--gcc/gimple-fold.c7
3 files changed, 17 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0289142..a6a5851 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2014-03-18 Martin Liska <mliska@suse.cz>
+
+ * cgraph.c (cgraph_update_edges_for_call_stmt_node): Added case when
+ gimple call statement is update.
+ * gimple-fold.c (gimple_fold_call): Changed order for GIMPLE_ASSIGN and
+ GIMPLE_CALL, where gsi iterator still points to GIMPLE CALL.
+
2014-03-18 Jakub Jelinek <jakub@redhat.com>
PR sanitizer/60557
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index a15b6bc..577352f 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1519,7 +1519,10 @@ cgraph_update_edges_for_call_stmt_node (struct cgraph_node *node,
{
if (callee->decl == new_call
|| callee->former_clone_of == new_call)
- return;
+ {
+ cgraph_set_call_stmt (e, new_stmt);
+ return;
+ }
callee = callee->clone_of;
}
}
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index eafdb2d..267c1fd 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -1153,8 +1153,13 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
{
tree var = create_tmp_var (TREE_TYPE (lhs), NULL);
tree def = get_or_create_ssa_default_def (cfun, var);
- gsi_insert_before (gsi, new_stmt, GSI_SAME_STMT);
+
+ /* To satisfy condition for
+ cgraph_update_edges_for_call_stmt_node,
+ we need to preserve GIMPLE_CALL statement
+ at position of GSI iterator. */
update_call_from_tree (gsi, def);
+ gsi_insert_before (gsi, new_stmt, GSI_NEW_STMT);
}
else
gsi_replace (gsi, new_stmt, true);