[Bug fortran/60928] gfortran issue with allocatable components and OpenMP

quantheory at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed May 14 05:04:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60928

--- Comment #3 from Sean Santos <quantheory at gmail dot com> ---
OpenMP 4.0 is strange. Sure, it does refer to "allocatable enhancement" as an
unsupported feature, which is vague. It might refer to the TR unofficially
known as the "Allocatable Enhancements" update, or it might refer to everything
at all that changed between 95 and 2003, or it might just be meant as a
disclaimer that some allocatable changes may not be covered. But at the same
time, OpenMP 4.0 contains an update that specifically discusses in the test
case I gave.

The language in OpenMP 4.0 (page 160):


'For a list item or the subobject of a list item with the ALLOCATABLE
attribute:

- if the allocation status is "not currently allocated", the new list item or
the subobject of the new list item will have an initial allocation status of
"not currently allocated";

- if the allocation status is "currently allocated", the new list item or the
subobject of the new list item will have an initial allocation status of
"currently allocated". If the new list item or the subobject of the new list
item is an array, its bounds will be the same as those of the original list
item or the subobject of the original list item.'


In comparison, the first line of the same section in OpenMP 3.1 (page 97):

'For a list item with the ALLOCATABLE attribute:'


There are other, similar lines that are changed throughout the standard. To me,
this seems like a specific statement of how to handle allocatable components,
which is new in OpenMP 4.0, and is more explicit than the vague statement about
unsupported features at the top of the standard.

However, if you disagree and think that this is not part of the standard, I'd
like to suggest it as a reasonable enhancement anyway, since I would assert
that there is only one reasonable behavior here, and most other Fortran
compilers (notably excepting ifort) act the same way.



More information about the Gcc-bugs mailing list