On Thu, Nov 14, 2013 at 10:39:02AM -0700, Aldy Hernandez wrote:
> On 11/14/13 10:05, Jakub Jelinek wrote:
> 
> [Balaji, see below for question.]
> 
> >On Thu, Nov 14, 2013 at 09:49:41AM -0700, Aldy Hernandez wrote:
> >>+    case OMP_PARALLEL:
> >>+    case OMP_TASK:
> >>+    case OMP_FOR:
> >>+    case OMP_SIMD:
> >>+    case OMP_SECTIONS:
> >>+    case OMP_SINGLE:
> >>+    case OMP_SECTION:
> >>+    case OMP_MASTER:
> >>+    case OMP_ORDERED:
> >>+    case OMP_CRITICAL:
> >>+    case OMP_ATOMIC:
> >>+    case OMP_ATOMIC_READ:
> >>+    case OMP_ATOMIC_CAPTURE_OLD:
> >>+    case OMP_ATOMIC_CAPTURE_NEW:
> >
> >This is only a subset of OpenMP statements.
> >You are missing OMP_DISTRIBUTE, OMP_TARGET, OMP_TARGET_DATA, OMP_TEAMS,
> >OMP_TARGET_UPDATE, OMP_TASKGROUP.
> >Also, CALL_EXPRs to
> >           case BUILT_IN_GOMP_BARRIER:
> >           case BUILT_IN_GOMP_CANCEL:
> >           case BUILT_IN_GOMP_CANCELLATION_POINT:
> >           case BUILT_IN_GOMP_TASKYIELD:
> >           case BUILT_IN_GOMP_TASKWAIT:
> >are OpenMP statements.  For OpenMP we diagnose this later on, in
> >check_omp_nesting_restrictions in omp-low.c, wouldn't it be better to
> >handle it there too?
> 
> Woah, indeed.  I removed all of this section in favor of the error
> in check_omp_nesting_restriction, and adjusted the testcase error
> accordingly.

Well, if you don't change anything in omp-low.c, then it wouldn't diagnose
setjmp call in #pragma simd, but given that also the OpenMP 4.0 spec
requires that #pragma omp simd doesn't contain calls to setjmp or longjmp
(ditto for #pragma omp declare simd functions), then scan_omp_1_stmt
should be changed to also call check_omp_nesting_restrictions for
setjmp/longjmp calls (the GIMPLE_CALL case then in
check_omp_nesting_restrictions can't assume all calls it sees are
BUILT_IN_NORMAL).

> >I'm surprised here, does the Cilk+ reduction clause really want to grok
> >OpenMP user defined reductions etc.?
> 
> Hmm, I doubt it.  Balaji, OpenMP user defined reductions are not
> allowed for Cilk Plus, right?
> 
> If so, Jakub what do you suggest, disallowing parsing of user
> defined reductions in cp_parser_omp_clause_reduction() when some
> Cilk Plus flag, or did you have something else in mind?

Perhaps some bool is_cilkplus = false argument to
cp_parser_omp_clause_reduction would work for me (and for C too).

        Jakub

Reply via email to