This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/16937] New: Compiler segmentation fault - compound derived types are not acceptable function arguments


! $ ../bin/gfortran bug4.f90 -o test
! bug4.f90: In function `MAIN__':
! bug4.f90:30: internal compiler error: Segmentation fault
! Please submit a full bug report,
! with preprocessed source if appropriate.
! See <URL:http://gcc.gnu.org/bugs.html> for instructions.
!
!Apparently compound derived types are not acceptable function arguments

  program Array_List 
    implicit none 
    character (len=5),dimension(3)  :: carray = (/"one","two","three"/)

    type :: Compound 
      integer                       :: Count 
      character (len = 4)           :: Name 
    end type Compound 

    type :: Table 
      type (Compound)               :: Data (2)  
      integer :: L_Size  
    end type Table 
 
    type (Compound)                 :: Element1  = Compound(1,"one")
    type (Compound)                 :: Element2  = Compound(2,"two")
 
    type (Table) :: ElementTable
    ElementTable%Data(1) = Element1
    ElementTable%Data(2) = Element2
    ElementTable%L_size  = 2 

    print *, test( ElementTable%Data(: ElementTable%L_size )%Name )

!! the following work correctly

!!    print *,  ElementTable%Data(: ElementTable%L_size )%Name 
!!    print *, test( carray )

    stop

      contains
        function test ( list ) result ( num )
	integer                      :: num
	character (len=*)            :: list(:)
	num = Size( List )
	return
	end function test

  end program Array_List

-- 
           Summary: Compiler segmentation fault - compound derived types are
                    not acceptable function arguments
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: paulthomas2 at wanadoo dot fr
                CC: bdavis at gcc dot gnu dot org,gcc-bugs at gcc dot gnu
                    dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]