------- Comment #6 from burnus at gcc dot gnu dot org  2008-09-12 20:42 -------
> This is equivalent to the ever popular use of EQUIVALENCE to set a
> real type to Inf or NaN via integers.

Actually, it is a bit different: Here, already the COMMON is invalid for
EQUIVALENCE only accessing the value is invalid as the value is undefined.
Default integer and default real are in the same storage sequence (and here
probably the analog to EQUIVALENCE holds). I think the following program is
valid according to the standard and it has the same problem:

subroutine one()
  integer :: i
  common /com/ i
  print *, i
end subroutine one

program test
integer :: j
real(8) :: r8
common /com/ i, r8 
i = 5
call one()
end program test

(If I recall correctly, the commons do not need to have the same size, but the
shorter ones need to be identical to the longer one minus the extra elements.)


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2008-09-12 20:42:06
               date|                            |


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

Reply via email to