cfgexpand.c (expand_call_stmt): Convert the function type to the original one if...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 15 Apr 2011 07:59:26 +0000 (07:59 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 15 Apr 2011 07:59:26 +0000 (07:59 +0000)
* 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
gcc/cfgexpand.c

index 7808f4cf13c4a6d38e55fc356805471aaaf0383c..9051d4305596dc97f6faf2130322079548247660 100644 (file)
@@ -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>
 
index 45a638356b1f10abaccc441ce08f8fd7ba4c37a2..c2d71f43bad974a6af29c0b6d36b707309f1e0be 100644 (file)
@@ -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);