diff mbox

[hsa-branch,5/9] Properly detect variadic arguments

Message ID E1btd8h-0002Iw-3V@eggs.gnu.org
State New
Headers show

Commit Message

Martin Jambor Oct. 10, 2016, 3:23 p.m. UTC
Hi,

this patch from Martin properly detects some variadic calls which we have
failed to detect before during expansion to HSAIL.

Committed to the branch, queued for merge to trunk soon.
Thanks,

Martin

2016-10-03  Martin Liska  <mliska@suse.cz>
	    Martin Jambor  <mjambor@suse.cz>

	* hsa-gen.c (verify_function_arguments): Properly detect variadic
	arguments.
---
 gcc/hsa-gen.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index efb87a0..ac83e9e 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -3444,13 +3444,14 @@  gen_hsa_insns_for_switch_stmt (gswitch *s, hsa_bb *hbb)
 static void
 verify_function_arguments (tree decl)
 {
+  tree type = TREE_TYPE (decl);
   if (DECL_STATIC_CHAIN (decl))
     {
       HSA_SORRY_ATV (EXPR_LOCATION (decl),
 		     "HSA does not support nested functions: %D", decl);
       return;
     }
-  else if (!TYPE_ARG_TYPES (TREE_TYPE (decl)))
+  else if (!TYPE_ARG_TYPES (type) || stdarg_p (type))
     {
       HSA_SORRY_ATV (EXPR_LOCATION (decl),
 		     "HSA does not support functions with variadic arguments "