This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/70068] ICE: out of memory on involving empty substring
- 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, 03 Mar 2016 20:41:50 +0000
- Subject: [Bug fortran/70068] ICE: out of memory on involving empty substring
- Auto-submitted: auto-generated
- References: <bug-70068-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70068
--- Comment #1 from Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de> ---
Similar :
$ cat z7.f90
program p
integer :: i
character(3), parameter :: x(3) = ['abc', 'ijk', 'xyz']
character(3), parameter :: y(2) = [(x(i)(i:1), i=2,3)]
end
$ gfortran-6 z7.f90
*** Error in `/usr/lib64/gcc/x86_64-suse-linux/6/f951': malloc(): memory
corruption: 0x0000000003081750 ***
$ cat z8.f90
program p
integer :: i
character(3), parameter :: x(3) = ['abc', 'ijk', 'xyz']
character(3) :: y(2) = [(x(i)(i:1), i=2,3)]
end
$ gfortran-6 z8.f90
*** Error in `/usr/lib64/gcc/x86_64-suse-linux/6/f951': malloc(): memory
corruption: 0x00000000025d6730 ***
$ cat z9.f90
program p
integer :: i
character(3), parameter :: x(3) = ['abc', 'ijk', 'xyz']
character(3) :: y(2)
y = [(x(i)(i:1), i=2,3)]
end
$ gfortran-6 z9.f90
*** Error in `/usr/lib64/gcc/x86_64-suse-linux/6/f951': malloc(): memory
corruption: 0x0000000002b57900 ***
Compiles and runs :
$ cat za.f90
program p
integer :: i
character(3) :: x(3)
character(3) :: y(2)
x = ['abc', 'ijk', 'xyz']
y = [(x(i)(i:1), i=2,3)]
print *, len_trim(x), x
print *, len_trim(y)
end
$ gfortran-6 za.f90
$ a.out
3 3 3 abcijkxyz
0 0