From 6d6efbb3b30874a7e3e2b66085e390f44f500ab3 Mon Sep 17 00:00:00 2001 From: "Balaji V. Iyer" Date: Wed, 5 Jun 2013 19:43:44 +0000 Subject: +2013-06-04 Balaji V. +2013-06-04 Balaji V. Iyer + + * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus + reduction functions outside the for-loop. Also, added a check if the + fundecl is non-NULL. + +2013-06-05 Balaji V. Iyer + + PR C/57457 + * c-c++-common/cilk-plus/AN/pr57457.c: New test. + * c-c++-common/cilk-plus/AN/pr57457-2.c: Likewise. + From-SVN: r199709 --- gcc/c/ChangeLog | 7 +++++++ gcc/c/c-typeck.c | 27 ++++++--------------------- 2 files changed, 13 insertions(+), 21 deletions(-) (limited to 'gcc/c') diff --git a/gcc/c/ChangeLog b/gcc/c/ChangeLog index 48be2fd..2543f5d 100644 --- a/gcc/c/ChangeLog +++ b/gcc/c/ChangeLog @@ -1,3 +1,10 @@ +2013-06-05 Balaji V. Iyer + + * c-typeck.c (convert_arguments): Moved checking of builtin cilkplus + reduction functions outside the for-loop. Added a check if the fundecl + is non-NULL. Finally, removed an unwanted if-statement, and made the + body unconditional. + 2013-06-03 Balaji V. Iyer * c-typeck.c (c_finish_if_stmt): Added a check to see if the rank of the diff --git a/gcc/c/c-typeck.c b/gcc/c/c-typeck.c index e5e1455..3a92311 100644 --- a/gcc/c/c-typeck.c +++ b/gcc/c/c-typeck.c @@ -2942,6 +2942,8 @@ convert_arguments (tree typelist, vec *values, break; } } + if (flag_enable_cilkplus && fundecl && is_cilkplus_reduce_builtin (fundecl)) + return vec_safe_length (values); /* Scan the given expressions and types, producing individual converted arguments. */ @@ -2959,17 +2961,6 @@ convert_arguments (tree typelist, vec *values, bool npc; tree parmval; - // FIXME: I assume this code is here to handle the overloaded - // behavior of the __sec_reduce* builtins, and avoid giving - // argument mismatch warnings/errors. We should probably handle - // this with the resolve_overloaded_builtin infrastructure. - /* If the function call is a builtin function call, then we do not - worry about it since we break them up into its equivalent later and - we do the appropriate checks there. */ - if (flag_enable_cilkplus - && is_cilkplus_reduce_builtin (fundecl)) - continue; - if (type == void_type_node) { if (selector) @@ -3207,16 +3198,10 @@ convert_arguments (tree typelist, vec *values, if (typetail != 0 && TREE_VALUE (typetail) != void_type_node) { - /* If array notation is used and Cilk Plus is enabled, then we do not - worry about this error now. We will handle them in a later place. */ - if (!flag_enable_cilkplus - || !is_cilkplus_reduce_builtin (fundecl)) - { - error_at (input_location, - "too few arguments to function %qE", function); - inform_declaration (fundecl); - return -1; - } + error_at (input_location, + "too few arguments to function %qE", function); + inform_declaration (fundecl); + return -1; } return error_args ? -1 : (int) parmnum; -- cgit v1.1