This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix oversight in call gimplification
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 8 May 2014 12:54:28 +0200 (CEST)
- Subject: [PATCH] Fix oversight in call gimplification
- Authentication-results: sourceware.org; auth=none
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);