This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [OpenACC 4/11] C FE changes
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Cesar Philippidis <cesar_philippidis at mentor dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Bernd Schmidt <bschmidt at redhat dot com>, Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Mon, 26 Oct 2015 09:59:49 +0100
- Subject: Re: [OpenACC 4/11] C FE changes
- Authentication-results: sourceware.org; auth=none
- References: <20151022082249 dot GF478 at tucnak dot redhat dot com> <562A95C3 dot 2040100 at mentor dot com> <20151023203155 dot GJ478 at tucnak dot redhat dot com> <562AA73D dot 6010809 at mentor dot com> <562AED97 dot 5070803 at mentor dot com> <20151024080356 dot GL478 at tucnak dot redhat dot com> <562BF3C2 dot 4060901 at mentor dot com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Sat, Oct 24, 2015 at 02:10:26PM -0700, Cesar Philippidis wrote:
> +static tree
> +c_parser_oacc_shape_clause (c_parser *parser, omp_clause_code kind,
> + const char *str, tree list)
> +{
> + const char *id = "num";
> + tree ops[2] = { NULL_TREE, NULL_TREE }, c;
> + location_t loc = c_parser_peek_token (parser)->location;
> +
> + if (kind == OMP_CLAUSE_VECTOR)
> + id = "length";
> +
> + if (c_parser_next_token_is (parser, CPP_OPEN_PAREN))
> + {
> + c_parser_consume_token (parser);
> +
> + do
> + {
> + c_token *next = c_parser_peek_token (parser);
> + int idx = 0;
> +
> + /* Gang static argument. */
> + if (kind == OMP_CLAUSE_GANG
> + && c_parser_next_token_is_keyword (parser, RID_STATIC))
> + {
> + c_parser_consume_token (parser);
> +
> + if (!c_parser_require (parser, CPP_COLON, "expected %<:%>"))
> + goto cleanup_error;
> +
> + idx = 1;
> + if (ops[idx] != NULL_TREE )
Spurious space before ).
> + {
> + c_parser_error (parser, "too many %<static%> arguements");
Typo, arguments.
> +static tree
> +c_parser_oacc_simple_clause (c_parser *parser ATTRIBUTE_UNUSED,
> + enum omp_clause_code code, tree list)
Please remove the useless ATTRIBUTE_UNUSED, you are using that parameter
unconditionally in c_parser_peek_token (parser).
> +{
> + check_no_duplicate_clause (list, code, omp_clause_code_name[code]);
> +
> + tree c = build_omp_clause (c_parser_peek_token (parser)->location, code);
> + OMP_CLAUSE_CHAIN (c) = list;
> +
> + return c;
> +}
> +
> +int main ()
> +{
> + int i;
> + int v, w;
> + int length, num;
Can you please initialize the v/w/length/num variables?
> + #pragma acc kernels
> +#pragma acc loop gang(16, 24) /* { dg-error "unexpected argument" } */
> + for (i = 0; i < 10; i++)
Missing indentation of the acc loop line.
Ok for trunk with those changes fixed.
Jakub