This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix oversight in call gimplification


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  <rguenther@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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]