From b25aa0e83fa9918bf5a95d28487fabe3c37f40f6 Mon Sep 17 00:00:00 2001
From: Eric Botcazou <ebotcazou@adacore.com>
Date: Fri, 15 Apr 2011 07:59:26 +0000
Subject: [PATCH] cfgexpand.c (expand_call_stmt): Convert the function type to
 the original one if this is not a builtin function.

	* cfgexpand.c (expand_call_stmt): Convert the function type to the
	original one if this is not a builtin function.

From-SVN: r172471
---
 gcc/ChangeLog   | 6 +++---
 gcc/cfgexpand.c | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7808f4cf13c4..9051d4305596 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,7 +1,7 @@
-2011-04-14  Eric Botcazou  <ebotcazou@adacore.com>
+2011-04-15  Eric Botcazou  <ebotcazou@adacore.com>
 
-	* cfgexpand.c (expand_call_stmt): Rematerialize the original function
-	type if this is not a builtin function.
+	* cfgexpand.c (expand_call_stmt): Convert the function type to the
+	original one if this is not a builtin function.
 
 2011-04-14  Jakub Jelinek  <jakub@redhat.com>
 
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 45a638356b1f..c2d71f43bad9 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1851,8 +1851,8 @@ expand_call_stmt (gimple stmt)
      call is made may be different from the type of the function.  */
   if (!builtin_p)
     CALL_EXPR_FN (exp)
-      = fold_build1 (NOP_EXPR, build_pointer_type (gimple_call_fntype (stmt)),
-		     CALL_EXPR_FN (exp));
+      = fold_convert (build_pointer_type (gimple_call_fntype (stmt)),
+		      CALL_EXPR_FN (exp));
 
   TREE_TYPE (exp) = gimple_call_return_type (stmt);
   CALL_EXPR_STATIC_CHAIN (exp) = gimple_call_chain (stmt);
-- 
GitLab