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

            Bug ID: 57992
           Summary: Pointless packing of contiguous arrays for simply
                    contiguous functions results as actual arguments
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: burnus at gcc dot gnu.org

allocatables, pointer+contiguous and explicit-size arrays are all (simply)
contiguous.

However, gfortran adds _gfortran_internal_pack/_gfortran_internal_unpack calls
in all three cases:

subroutine test
  interface
    function f1()
      integer, allocatable :: f1(:)
    end function f1
    function f2()
      integer, pointer, contiguous :: f2(:)
    end function f2
    function f3()
      integer :: f3(5)
    end function f3
  end interface

 call bar(f1())
 call bar(f2())
 call bar(f3())
end subroutine test

!call test()
!end

Reply via email to