Re: [PATCH 2/5] Error out for Cilk_spawn or array expression in forbidden places

2014-10-02 Thread Joseph S. Myers
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

[PATCH 2/5] Error out for Cilk_spawn or array expression in forbidden places

2014-10-01 Thread Andi Kleen
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