This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PING: Fwd: Re: [patch] implement Cilk Plus simd loops on trunk
- From: Jason Merrill <jason at redhat dot com>
- To: Aldy Hernandez <aldyh at redhat dot com>, Richard Henderson <rth at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 02 Oct 2013 17:53:54 -0400
- Subject: Re: PING: Fwd: Re: [patch] implement Cilk Plus simd loops on trunk
- Authentication-results: sourceware.org; auth=none
- References: <51F299D3 dot 5020907 at redhat dot com> <521269E0 dot 1020104 at redhat dot com> <521B8ECA dot 70806 at redhat dot com> <521D060E dot 9030601 at redhat dot com>
On 08/27/2013 04:03 PM, Aldy Hernandez wrote:
+ /* First, try to parse as an initialized declaration. See
+ cp_parser_condition, from whence the bulk of this is copied. */
You didn't do this copy, but I'd appreciate it if you could reintegrate
this with cp_parser_condition. I notice that there's already been
significant drift: this copied code doesn't recognize {} initialization.
+ else if (!TREE_TYPE (e) || !TREE_CONSTANT (e)
+ || !INTEGRAL_TYPE_P (TREE_TYPE (e)))
+ cp_parser_error (parser,
+ "step size must be an integer constant");
Can't the step size be a value-dependent expression like a template
non-type parameter?
+ if (cp_lexer_next_token_is_keyword (parser->lexer, RID_STATIC)
+ || cp_lexer_next_token_is_keyword (parser->lexer, RID_REGISTER)
+ || cp_lexer_next_token_is_keyword (parser->lexer, RID_EXTERN)
+ || cp_lexer_next_token_is_keyword (parser->lexer, RID_MUTABLE)
+ || cp_lexer_next_token_is_keyword (parser->lexer, RID_THREAD))
+ {
+ error_at (loc, "storage class is not allowed");
+ cp_lexer_consume_token (parser->lexer);
+ }
How is this different from any other for-loop?
+ gcc_assert (for_keyword == RID_FOR);
+
+ if (!cp_lexer_next_token_is_keyword (parser->lexer, for_keyword))
+ {
+ if (for_keyword == RID_FOR)
A lot of code in this function tests for_keyword after the assert. A
comment lower down says
+ /* Handle _Cilk_for here when implemented. */
+ gcc_unreachable ();
So do we need the earlier assert? At least add a comment to it.
Jason