In a project I am working on, I changed a fixed length string in a structure within a module to a deferred length string and the result was an internal compiler error (the code compiled and ran without issue before the change). I cannot reproduce the internal compiler error with a simple case, but I do get a segmentation fault in the below program when it hits the WRITE() statement. It is unclear to me what the issue is or if this is even related to the internal compiler error I was trying to reproduce. When compiling with '-std03', I get "warning #5436: Overlapping storage initializations encountered with S", so maybe it has something to do with the initialization, though I do not see multiple initializations here.
Fortran compiler version is Version 126.96.36.199 (64-bit), on Ubuntu 14.04 (beta).
The code is also attached:
MODULE stringmod TYPE, PUBLIC :: A CHARACTER(LEN=:), ALLOCATABLE :: string END TYPE TYPE(A), SAVE :: S = A('_test__TEST_') CONTAINS SUBROUTINE TestPrint() WRITE(*,*) S%string END SUBROUTINE END MODULE PROGRAM stringtest USE stringmod CALL TestPrint() END PROGRAM