This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[hsa-branch 5/9] Properly detect variadic arguments
- From: Martin Jambor <mjambor at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 10 Oct 2016 17:23:29 +0200
- Subject: [hsa-branch 5/9] Properly detect variadic arguments
- Authentication-results: sourceware.org; auth=none
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 --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 "
--
2.10.0