On 06/04/2013 11:37 AM, Iyer, Balaji V wrote:
Yes, that does simplify the whole thing. Here is an updated ChangeLog
and patch (with testcode) attached. So, is it Ok for trunk?
gcc/testsuite/ChangeLog 2013-06-04 Balaji V. Iyer
<balaji.v.i...@intel.com>
PR C/57457 * c-c++-common/cilk-plus/AN/pr57457.c: New test.
gcc/c/ChangeLog 2013-06-04 Balaji V. Iyer
<balaji.v.i...@intel.com>
* 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.
OK. This looks good. Please install.
As a follow-up, don't we need to do something with the test after the
loop as well:
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;
}
}
ISTM we need to check for a NULL FUNDECL here too.
jeff