Re: Run-time error with gfortran -fbounds-check



I can't send the code because it is copyrighted, but I checked the
dummy arguments and found something possibly wrong: I have
declarations like this

REAL(KIND=8), INTENT(IN) :: r(:)

in a F90 subroutine. Is it wrong? why does the compiler accept it?

The following example is compiled without any problem, but does a run-
time segmentation fault

principal.f:

PROGRAM principal

IMPLICIT NONE

integer n
real*8 x(256)
n=6
call work(x,n)

END PROGRAM

work.f90:

SUBROUTINE work(z,k)

IMPLICIT NONE

REAL(KIND=8), intent(in) :: z(:)
INTEGER,intent(in) :: k
integer :: i

do i=1,k
write(*,*) i,z(i)
end do

END SUBROUTINE

.



Relevant Pages

  • Re: Ada exception block does NOT work?
    ... The parameter/formal declarations are like ... the compiler would guess for you how to call puts. ... > * implicit declaration of external functions. ... > K&R probably where good assember programmers but they where lousy compiler ...
    (comp.lang.ada)
  • Re: Turning compiler optimizations off causes segmentation fault
    ... > compiler optimization level. ... > mysterious segmentation fault from subroutine LeftRotateRBTree. ... > IMPLICIT NONE ... You do NULLIFY the components of z a few lines down. ...
    (comp.lang.fortran)
  • Re: trim(string) problems
    ... Bruce wrote: ... > Together these make me think it is a compiler problem ... > sizewhen the subroutine is used from a module ... > but correctly finds size with both explicit and implicit ...
    (comp.lang.fortran)
  • Re: fortran 90/95 standart
    ... SUBROUTINE eval ... IMPLICIT REAL ... Can you update to a newer compiler 4.0.1 is fairly in gfortran development? ... The previous version was mixing C and fortran subroutines and is not used anymore It is not a good candidate for testing a new compiler! ...
    (comp.lang.fortran)
  • Re: Module Fortran 90
    ... implicit none ... integer,dimension, pointer:: A ... is not declarations that are accessed from a module. ... compiler), showing exactly what you did, and exactly what the resulting ...
    (comp.lang.fortran)