[Bug fortran/70913] ICE in gfc_encode_character, at fortran/target-memory.c:227

gerhard.steinmetz.fortran@t-online.de gcc-bugzilla@gcc.gnu.org
Thu May 19 20:22:00 GMT 2016


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70913

--- Comment #3 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Another situation :

$ cat z4.f90
program p
   character(3) :: a(2) = ['abc', 'xyz']
   character(3) :: b(1,2) = ' '
   equivalence (b, a)
end

$ gfortran-6 z4.f90
internal compiler error: in gfc_encode_character, at
fortran/target-memory.c:227

---

Interestingly, this works without initializer of b :

$ cat z5.f90
program p
   character(3) :: a(2) = ['abc', 'xyz']
   character(3) :: b(1,2)
   equivalence (b, a)
   print *, b
end

$ gfortran-6 z5.f90
$ a.out
 abcxyz


Even more, with option -finit-character/-finit-local-zero :

$ gfortran-6 -g -O0 -Wall -fcheck=all -finit-character=7 z5.f90
$ a.out
 abcxyz


More information about the Gcc-bugs mailing list