On Wed, 1 Oct 2014, Andi Kleen wrote:
> +/* Check that no array notation or spawn statement is in EXPR.
> + If not true gemerate an error at LOC for WHAT. */
> +
> +bool
> +check_no_cilk (tree expr, const char *what, location_t loc)
> +{
> + if (!flag_cilkplus)
> +return false;
> + if (co
From: Andi Kleen
_Cilk_spawn or Cilk array expressions are only allowed on their own,
but not in for(), if(), switch, do, while, goto, etc.
The C parser didn't always check for that, which lead to ICEs earlier
for invalid code.
Add a generic helper that checks this and call it where needed
in th