Compiling gives twice the error message:
  Error: Element of assumed-shaped array passed to dummy argument 'y'

Other compilers give it only for "rdiff2"; thinking over it, there is no reason
to reject it for "rdiff" as the memory is contiguous which might not be the
case for dummy arguments (stripes!). I will try to dig out the exact wording
from the standard. The check was added by me in  PR34665.

A simple fix would be to check for attr.dummy, but maybe one has to do
something else.

subroutine test(rdiff2)
implicit none
interface
  subroutine rlv(y)
    real   :: y(3)
  end subroutine rlv
end interface

real, allocatable :: rdiff(:,:,:)
real :: rdiff2(:,:,:)
call rlv(rdiff(1,1,1))  ! OK, it is contiguous memory (error wrong)
call rlv(rdiff2(1,1,1)) ! WRONG, error is ok (non contiguous)
end


-- 
           Summary: [4.3 Regression] Too strict error checking for assumed-
                    shaped 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: burnus at gcc dot gnu dot org


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

Reply via email to