------- Comment #5 from fengwang at gcc dot gnu dot org 2006-01-11 03:18 ------- Also fails on ia64-linux-gnu. This is the ruduced case:
module cutils implicit none private type t integer :: kk(3) = (/30, 40, 50 /) end type t integer :: n8 = 3 type(t) :: tt2 public :: IntToChar7 contains function IntToChar7(integerValue) result(a) integer, intent(in) :: integerValue character(len=tt2%kk(n8)) :: a write(a, *) integerValue end function IntToChar7 end module cutils program test use cutils end program test And the dumped parse tree: Namespace: A-Z: (UNKNOWN 0) procedure name = cutils symtree: n8 Ambig 0 symbol n8 (INTEGER 4)(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC) value: 3 symtree: cutils Ambig 0 symbol cutils (UNKNOWN 0)(MODULE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC) symtree: inttochar7 Ambig 0 symbol inttochar7 (CHARACTER cutils:tt2 % kk(__convert_i4_i8[[((cutils:n8))]]))(PROCEDURE UNKNOWN-INTENT PUBLIC MODULE-PROC FUNCTION) result: a Formal arglist: integervalue symtree: t Ambig 0 symbol t (UNKNOWN 0)(DERIVED UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC) components: (kk (INTEGER 4) DIMENSION (1 AS_EXPLICIT 1 3 )) symtree: tt2 Ambig 0 symbol tt2 (DERIVED t)(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC) value: t((/ 30 , 40 , 50 /)) CONTAINS Namespace: A-Z: (UNKNOWN 0) procedure name = inttochar7 symtree: a Ambig 0 symbol a (CHARACTER cutils:tt2 % kk(__convert_i4_i8[[((cutils:n8))]]))(VARIABLE UNKNOWN-INTENT UNKNOWN-ACCESS UNKNOWN-PROC RESULT) symtree: integervalue Ambig 0 symbol integervalue (INTEGER 4)(VARIABLE IN UNKNOWN-ACCESS UNKNOWN-PROC DUMMY) symtree: inttochar7 Ambig 0 from namespace cutils WRITE UNIT=inttochar7:a FMT=-1 TRANSFER inttochar7:integervalue DT_END char_result_11.f90:0: 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. Please note that symbol inttochar7 (CHARACTER cutils:tt2 % kk(__convert_i4_i8[[((cutils:n8))]])) I think it's the conversion that triggers the ICE. And If I use literal constant 3 instead of n8 in the fortran source code, it will be passed. -- fengwang at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fengwang at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25716