[PR72741, PR89433] Repeated use of the Fortran OpenACC 'routine' directive

Thomas Schwinge thomas@codesourcery.com
Thu Mar 21 20:01:00 GMT 2019


Hi!

On Thu, 28 Feb 2019 21:37:21 +0100, I wrote:
> On Mon, 15 Aug 2016 18:54:49 -0700, Cesar Philippidis <cesar@codesourcery.com> wrote:
> > [...]
> > 
> > Note that besides for checking for multiple acc routine directives, this
> > patch also handles the case where the optional name argument in 'acc
> > routine (NAME)' is the name of the current procedure. This was a TODO
> > item in gomp4.
> 
> > --- a/gcc/fortran/openmp.c
> > +++ b/gcc/fortran/openmp.c
> 
> > @@ -1969,6 +1971,13 @@ gfc_match_oacc_routine (void)
> >  	      gfc_current_locus = old_loc;
> >  	      return MATCH_ERROR;
> >  	    }
> > +
> > +	  /* Set sym to NULL if it matches the current procedure's
> > +	     name.  This will simplify the check for duplicate ACC
> > +	     ROUTINE attributes.  */
> > +	  if (gfc_current_ns->proc_name
> > +	      && !strcmp (buffer, gfc_current_ns->proc_name->name))
> > +	    sym = NULL;
> >  	}
> >        else
> >          {
> 
> I re-worked the code a bit, didn't find this necessary.

Specifically, a very similar check has already been present, comparing to
'sym->name' instead of 'buffer'.  (Not sure, if one is to be preferred
over the other, when/if they would ever be different.  It feels like
instead of these strings, we should be comparing some kind of symbolic
"resolved" handle, "sym".  And, as it should turn out, I have a cleanup
patch for next GCC development stage 1 to clean up that and other stuff
in 'gfc_match_oacc_routine'.)

Anyway, to clarify, I committed to trunk r269856 "[PR72741] The name in a
Fortran OpenACC 'routine' directive refers to the containing subroutine
or function", see attached.


Grüße
 Thomas


-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-PR72741-The-name-in-a-Fortran-OpenACC-routine-.trunk.patch
Type: text/x-diff
Size: 2894 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190321/93db1cc5/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 658 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20190321/93db1cc5/attachment.sig>


More information about the Gcc-patches mailing list