[Bug fortran/68155] ICE on initializing character array in type (len_lhs <> len_rhs)
gerhard.steinmetz.fortran@t-online.de
gcc-bugzilla@gcc.gnu.org
Thu Oct 29 18:37:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68155
--- Comment #2 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Fails (again len_lhs <> len_rhs) :
$ cat z3t.f90
program p
type t
character(2) :: z(1) = 'ab' // ['y']
end type
type(t) :: z
print *, z
end
$ gfortran -g -O0 -Wall -fcheck=all z3t.f90
z3t.f90:3:28:
character(2) :: z(1) = 'ab' // ['y']
1
Warning: CHARACTER expression at (1) is being truncated (3/2)
[-Wcharacter-truncation]
f951: internal compiler error: Segmentation fault
---
Again, works without type :
$ cat z3c.f90
program p
character(2) :: z(1) = 'ab' // ['y']
print *, z
end
$ gfortran -g -O0 -Wall -fcheck=all z3c.f90
z3c.f90:2:25:
character(2) :: z(1) = 'ab' // ['y']
1
Warning: CHARACTER expression at (1) is being truncated (3/2)
[-Wcharacter-truncation]
$ a.out
ab
---
Eventually one of the recent patches cures this one too.
More information about the Gcc-bugs
mailing list