http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49586
--- Comment #6 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-06-30
17:28:48 UTC ---
> Unfortunately, this patch breaks gfortran.fortran-torture/execute/data.f90
> compilation, it fails with a cryptic error.
Confirmed. A reduced test is
! Program to test data statement
program data
call sub1()
end
subroutine sub1()
integer i
type tmp
integer, dimension(4)::a
real :: r
end type
type tmp1
type (tmp) t1(4)
integer b
end type
type (tmp1) tmp2(2)
! Full array and scalar component initializer
data tmp2(2)%t1(2)%r, tmp2(1)%t1(3)%a,
tmp2(1)%b/220,136,137,138,139,10/
data tmp2(2)%t1(2)%a(3), tmp2(2)%t1(2)%a(1)/223,221/
end
The error is emitted in show_loci in gcc/fortran/error.c when
l1 == NULL || l1->lb == NULL
With gdb I get
Breakpoint 1, show_loci (l1=0x141d23260, l2=0x0) at
../../work/gcc/fortran/error.c:383
383 if (l1 == NULL || l1->lb == NULL)
(gdb) p l1
$1 = (locus *) 0x141d23260
(gdb) p *l1
$2 = {
nextc = 0x0,
lb = 0x0
}
(gdb) bt
#0 show_loci (l1=0x141d23260, l2=0x0) at ../../work/gcc/fortran/error.c:383
#1 0x000000010002832d in error_print (type=0x100a46df1 "Error:",
format0=0x100a63ad0 "non-constant initialization expression at %L",
argp=0x7fff5fbfd128) at ../../work/gcc/fortran/error.c:627
Previous frame inner to this frame (gdb could not unwind past this frame)