(was "Re: more accurate omp in fortran" Ping.
Cesar On 10/22/2015 08:21 AM, Cesar Philippidis wrote: > Currently, for certain omp and oacc errors the fortran will inaccurately > report exactly where in the omp/acc construct the error has occurred. E.g. > > !$acc parallel copy (i) copy (i) copy (j) > 1 > Error: Symbol ‘i’ present on multiple clauses at (1) > > instead of > > !$acc parallel copy (i) copy (i) copy (j) > 1 > Error: Symbol ‘i’ present on multiple clauses at (1) > > The problem here is how the front end uses the locus for the construct > and not the individual clause. As a result that diagnostic pointer > points to the end of the construct. > > This patch teaches gfc_resolve_omp_clauses how to use the locus of each > individual clause instead of the construct when reporting errors > involving OMP_LIST_ clauses (which are typically clauses involving > variables). It's still not perfect, but it does improve the quality of > the error reporting a little. In particular, in openacc, other compilers > are somewhat lenient in allowing variables to appear in multiple > clauses, e.g. copyin (foo) copyout (foo), but this is clearly forbidden > by the spec. I received some bug reports complaining that gfortran's > errors aren't accurate. > > I've also split off the check for variables appearing in multiple > clauses into a separate function. It's a little overkill for trunk right > now, but it is used quite a bit in gomp4 for oacc declare. > > I've tested these changes on x86_64. Is this ok for trunk? > > Cesar > >