This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch, openmp/openacc] Allow Fortran parameters in map/copy.


On Fri, Jul 05, 2019 at 02:15:12PM +0200, Jakub Jelinek wrote:
> On Fri, Jul 05, 2019 at 01:10:00PM +0100, Andrew Stubbs wrote:
> > > so I don't believe Fortran parameters are OpenMP variables.
> > > Scalar Fortran parameters don't even have any data storage block associated
> > > with them at all.
> > 
> > Agreed, they are not variables (nor variable), and copying them about is
> > entirely pointless (although, if you simply remove the error check GCC will
> > happily create storage for 'N' and do the copies).
> > 
> > And yet, this issue has generated a support request from a blocked customer,
> > and I'd like to improve their experience.
> > 
> > I could generate a warning, or add a note to the error message, but in the
> > interests of portability I thought just doing the right thing would be
> > nicer.
> > 
> > Any suggestions?
> 
> I don't know what OpenACC says, perhaps it is different.
> 
> For OpenMP, a warning is not good enough, because if Fortran PARAMETER is
> not a variable, then the program is invalid and needs to be rejected.
> You could improve the diagnostics by adding some explanation message that fortran
> PARAMETER is not a variable.

Got it confirmed, it might change in a future OpenMP release; and there has
been a change already in OpenMP 3.1 that might have intended to allow
Fortran PARAMETERs in firstprivate clause, but because the glossary hasn't
been changed, it is not valid even in firstprivate clause.

Note, if there is adjusted wording for Fortran PARAMETERs, it shouldn't be
done just for map clause, but all other OpenMP data sharing clauses.  Even
if PARAMETERs are eventually allowed as variables, it will be still limited
to firstprivate clause and perhaps some sorts of map clauses, nothing else,
e.g. for non-firstprivate privatization clauses you really need a definable
object or allocatable.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]