Coming from PR 29489, but I think it's better to keep a separate PR about it:

$ cat a.f90 
subroutine foo (x,n)
  integer x(7,n,2,*)

  print *, ubound(x,1)
  print *, ubound(x,2)
  print *, ubound(x,3)
!  print *, ubound(x,4)
!  print *, ubound(x)
end

  integer i(7,4,2,9)

  call foo(i,4)
end
$ ifort a.f90 && ./a.out
           7
           4
           2
$ gfortran a.f90 && ./a.out
 In file a.f90:5

  print *, ubound(x,2)
                 1
Error: The upper bound in the last dimension must appear in the reference to
the assumed size array 'x' at (1).


-- 
           Summary: UBOUND of non-last dimensions of assumed-size array
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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

Reply via email to