[Bug fortran/33317] New: CSHIFT: Crash if variable passed to DIM= is not present

burnus at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Sep 5 20:59:00 GMT 2007


The following program should print twice "T T T T" as if DIM is not present, 1
is assumed.

The standard does not forbid to pass a variable which has the OPTIONAL
attribute to CSHIFT. NAG f95 and ifort print as expected twice "T T T T".

gfortran simply crashes.

program test
 implicit none
 call sub(1)
 call sub()
contains
 subroutine sub(d)
   integer, optional :: d
   print *, cshift([.true.,.true.,.true.,.true.],1,d)
 end subroutine
end program test


-- 
           Summary: CSHIFT: Crash if variable passed to DIM= is not present
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          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=33317



More information about the Gcc-bugs mailing list