diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-29 13:00:35 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-11-29 13:00:35 +0000 |
commit | 648fd348b6457c4ac12b2b29b06bcafc62739e10 (patch) | |
tree | 6cfb0c8004407472eafd8773114fe3983adc250c /gcc/c-family/cilk.c | |
parent | 30ded303d62935b0b8a4c79e7552844603090078 (diff) | |
download | gcc-648fd348b6457c4ac12b2b29b06bcafc62739e10.tar.gz |
Properly handle function without arguments
PR c/59309
* cilk.c (gimplify_cilk_spawn): Properly handle function without
arguments.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@205525 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-family/cilk.c')
-rw-r--r-- | gcc/c-family/cilk.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/c-family/cilk.c b/gcc/c-family/cilk.c index c85b5f2a7c9..99d9c7e354d 100644 --- a/gcc/c-family/cilk.c +++ b/gcc/c-family/cilk.c @@ -757,7 +757,10 @@ gimplify_cilk_spawn (tree *spawn_p, gimple_seq *before ATTRIBUTE_UNUSED, /* This should give the number of parameters. */ total_args = list_length (new_args); - arg_array = XNEWVEC (tree, total_args); + if (total_args) + arg_array = XNEWVEC (tree, total_args); + else + arg_array = NULL; ii_args = new_args; for (ii = 0; ii < total_args; ii++) @@ -771,7 +774,7 @@ gimplify_cilk_spawn (tree *spawn_p, gimple_seq *before ATTRIBUTE_UNUSED, call1 = cilk_call_setjmp (cfun->cilk_frame_decl); - if (*arg_array == NULL_TREE) + if (arg_array == NULL || *arg_array == NULL_TREE) call2 = build_call_expr (function, 0); else call2 = build_call_expr_loc_array (EXPR_LOCATION (*spawn_p), function, |