aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cgraph.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr57330.c11
4 files changed, 23 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 0a7c1e7..bab6db4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2013-05-21 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/57330
+ * cgraph.c (cgraph_redirect_edge_call_stmt_to_callee): Properly
+ preserve the call stmts fntype.
+
+2013-05-21 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/57303
* tree-ssa-sink.c (statement_sink_location): Improve killing
stmt detection and properly handle self-assignments.
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 899f65c..2a2973b 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -1068,6 +1068,7 @@ cgraph_redirect_edge_call_stmt_to_callee (struct cgraph_edge *e)
= gimple_call_copy_skip_args (e->call_stmt,
e->callee->clone.combined_args_to_skip);
gimple_call_set_fndecl (new_stmt, e->callee->symbol.decl);
+ gimple_call_set_fntype (new_stmt, gimple_call_fntype (e->call_stmt));
if (gimple_vdef (new_stmt)
&& TREE_CODE (gimple_vdef (new_stmt)) == SSA_NAME)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0783914..1ba9007 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2013-05-21 Richard Biener <rguenther@suse.de>
+ PR tree-optimization/57330
+ * gcc.dg/torture/pr57330.c: New testcase.
+
+2013-05-21 Richard Biener <rguenther@suse.de>
+
PR tree-optimization/57303
* gcc.dg/torture/pr57303.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/torture/pr57330.c b/gcc/testsuite/gcc.dg/torture/pr57330.c
new file mode 100644
index 0000000..3e6cbcb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr57330.c
@@ -0,0 +1,11 @@
+/* { dg-do compile } */
+
+void foo (int a)
+{}
+
+void *a;
+void bar ()
+{
+ void **( *b ) ( ) = (void**(*)()) foo;
+ a = b (0);
+}