This is the mail archive of the gcc-bugs@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]

[Bug fortran/39239] Reject SAVEd variables EQUIVALENCEd to a COMMON



------- Comment #2 from burnus at gcc dot gnu dot org  2009-02-19 22:29 -------
Glan found the relevant part (see link above for more):

In 5.5.2.1: "Data objects associated with an entity in a common
             block are considered to be in that common block."

 * * *

BIND(C) in equivalence is wrong in general (see C576); there is currently a
warning printed, but the message is misleading:

module m
  integer :: i1, i2
  bind(C) :: i2
! common /block/ i1
  equivalence(i1,i2)
end module m

With COMMON, the warning (!) is the following; note that /BLOCK/ is not bind(C)
contrary to the message:

"Warning: Variable 'i1' in common block 'block' at (1) may not be a C
interoperable kind though common block 'block' is BIND(C)

Without COMMON, the warning (!) is also misleading:

"Warning: Variable 'i2' at (1) may not be a C interoperable kind but it is
bind(c)"

 * * *

Protected is already handled (cf. C584):
"Error: Either all or none of the objects in the EQUIVALENCE set at (1) shall
have the PROTECTED attribute"

 * * *

Volatile is not handled, though it [probably] should (cf. NOTE 5.22)
  integer :: i1, i2
  VOLATILE :: i2
  equivalence(i1,i2)
  end

 * * *

Asynchronous: Not yet supported in gfortran.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39239


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