This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/47348] New: substring with len_trim in array constructor
- From: "tkoenig at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 18 Jan 2011 18:14:40 +0000
- Subject: [Bug fortran/47348] New: substring with len_trim in array constructor
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47348
Summary: substring with len_trim in array constructor
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Keywords: wrong-code
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: tkoenig@gcc.gnu.org
Blocks: 19276
This one is strange; it is with recent trunk.
ig25@linux-fd1f:~/Krempel/Char-4> cat foo.f90
program main
implicit none
character(len=3) :: c(3)
c = 'x'
print '(3(A,"|"))', (/ (/ trim(c(1)), 'a' /)//'c', 'cd' /)
print '(3(A,"|"))', (/ (/ c(1)(1:len_trim(c(1))), 'a' /)//'c', 'cd' /)
print '(3(A,"|"))', (/ (/ c(1)(1:1), 'a' /)//'c', 'cd' /)
end program main
ig25@linux-fd1f:~/Krempel/Char-4> gfortran foo.f90
ig25@linux-fd1f:~/Krempel/Char-4> ./a.out
xc|ac|cd|
x |a |cd|
xc|ac|cd|
The second line should be identical to the first and third one.
Modified from nested_array_constructor_2.f90, BTW.
Goes back at least to 4.4.1, so probably not a regression.