http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57019
Bug #: 57019 Summary: Compiler crashes (and make wrong assignments) at some combinations of pointers Classification: Unclassified Product: gcc Version: 4.6.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassig...@gcc.gnu.org ReportedBy: thamb...@gmail.com This bug has two parts. !here we have types of data: type cParticle real(4) :: v(3),r0(2),rS(3),r1(2),SinA,CosA endtype cParticle type aParticle real(4) :: v(3),r0(2) endtype aParticle type pCItem type(aParticle) :: Atm type(cParticle) :: Ele type(cParticle) :: Ion end type pCItem !and array+pointers: type(pCItem),allocatable,target,dimension(:,:)::pCellArray type(cParticle),pointer,dimension(:,:)::pArray type(cParticle),pointer::p_pointer real(4),pointer,dimension(:)::v_pointer real(4),pointer::s_pointer allocate( pCellArray(1:ipMax,1:iCells) ) pArray=>pCellArray%Ele !for example !now let's try p_pointer=>pArray(1,1); and we have ~/src gfortran -Wall bug.f95 data_types.f95: In function ‘MAIN__’: data_types.f95:19: internal compiler error: Ошибка сегментирования Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.4/README.Bugs> for instructions. and we can achive this bug if we write s_pointer=>pArray(1,1)%SinA, but not if v_pointer=>pArray(1,1)%v !%%%%%%%%%%%%%%%%%%%%%%% the second part of this bug is wrong assignments. if we write "pArray(1,1)%v=10" -- only first component of vector will be written, but if we make it via transitional pointer "v_pointer=>pArray(1,1)%v ; v_pointer=10" -- everything is fine.