This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68155] ICE on initializing character array in type (len_lhs <> len_rhs)
- From: "gerhard dot steinmetz dot fortran at t-online dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 29 Oct 2015 18:37:25 +0000
- Subject: [Bug fortran/68155] ICE on initializing character array in type (len_lhs <> len_rhs)
- Auto-submitted: auto-generated
- References: <bug-68155-4 at http dot gcc dot gnu dot org/bugzilla/>
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.