OpenACC wait clause

Jakub Jelinek jakub@redhat.com
Fri Jun 24 15:59:00 GMT 2016


On Fri, Jun 24, 2016 at 08:42:49AM -0700, Cesar Philippidis wrote:
> >> @@ -1328,7 +1328,8 @@ gfc_match_omp_clauses (gfc_omp_clauses **cp, uint64_t mask,
> >>  	      && gfc_match ("wait") == MATCH_YES)
> >>  	    {
> >>  	      c->wait = true;
> >> -	      match_oacc_expr_list (" (", &c->wait_list, false);
> >> +	      if (match_oacc_expr_list (" (", &c->wait_list, false) == MATCH_NO)
> >> +		needs_space = true;
> >>  	      continue;
> >>  	    }
> >>  	  if ((mask & OMP_CLAUSE_WORKER)
> > 
> > I think it is still problematic.  Most of the parsing fortran FE errors are deferred,
> > meaning that if you don't reject the whole gfc_match_omp_clauses, then no
> > diagnostics is actually emitted.
> 
> What exactly is the problem here? Do you want more precise errors or do
> you want to keep the errors generic and deferred?

The problem is that if you ignore MATCH_ERROR and don't reject the stmt,
then invalid source will be accepted, which is not acceptable.

I admit the Fortran OpenMP/OpenACC error recovery and diagnostics is not
very good, but it generally follows the model done elsewhere in the Fortran
FE.  So, I think before changing anything substantial first the bugs in
there (where MATCH_ERROR is ignored) should be fixed (something that can be
also backported), and only afterwards we should be discussing some plan to
improve the infrastructure (like for clauses if there are any non-fatal
errors in the parsing emit the diagnostics immediately, don't add the
clauses to the FE IL and don't reject the whole stmt).

	Jakub



More information about the Gcc-patches mailing list