This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/40330] [4.4, 4.5 Regression] incorrect IO



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]