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

            Bug ID: 66377
           Summary: [F95] Wrong-code with equivalenced array in module
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: fxcoudert at gcc dot gnu.org
  Target Milestone: ---

This code:

module constant
  integer :: x(2), x1, x2
  equivalence (x(1),x1), (x(2),x2)
end module

program test
  use constant
  x = (/1, 2/)
  call another()
contains
  subroutine another()
    use constant, only : x1
    print *, x1
  end subroutine
end program

should output "1", but outputs "0" with all versions of gfortran tested.

Reply via email to