This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/40330] [4.4, 4.5 Regression] incorrect IO
- From: "jb at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Jun 2009 21:17:56 -0000
- Subject: [Bug libfortran/40330] [4.4, 4.5 Regression] incorrect IO
- References: <bug-40330-6642@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #24 from jb at gcc dot gnu dot org 2009-06-10 21:17 -------
Further reduced testcase:
program pr40330
implicit none
call s1()
call s1()
contains
subroutine s1()
character(LEN=100) :: a
a = "(3X)"
write(*,FMT='('//trim(a)//",a,' ')", ADVANCE="NO") "3"
end subroutine s1
end program pr40330
The interesting thing is, if you replace the trim(a) with trim("(3X)") then it
works. Look at -fdump-tree-original to see the difference; in the second case
the format string is a constant, in the first it's not and it's deallocated,
which might be related to why we get the valgrind errors about reading from
free'd storage.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40330