When gimplifying a call we now remember the original function type
used and record it in gimple_call_fntype.  But we fail to use
exactly that type for looking at TYPE_ARG_TYPES.  The following
fixes that.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2014-05-08  Richard Biener  <rguent...@suse.de>

        * gimplify.c (gimplify_call_expr): Use saved fnptrtype for
        looking at TYPE_ARG_TYPES.

Index: gcc/gimplify.c
===================================================================
--- gcc/gimplify.c      (revision 210207)
+++ gcc/gimplify.c      (working copy)
@@ -2329,8 +2329,8 @@ gimplify_call_expr (tree *expr_p, gimple
   parms = NULL_TREE;
   if (fndecl)
     parms = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
-  else if (POINTER_TYPE_P (TREE_TYPE (CALL_EXPR_FN (*expr_p))))
-    parms = TYPE_ARG_TYPES (TREE_TYPE (TREE_TYPE (CALL_EXPR_FN (*expr_p))));
+  else
+    parms = TYPE_ARG_TYPES (TREE_TYPE (fnptrtype));
 
   if (fndecl && DECL_ARGUMENTS (fndecl))
     p = DECL_ARGUMENTS (fndecl);

Reply via email to