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: "jvdelisle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jun 2009 02:25:13 -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 #26 from jvdelisle at gcc dot gnu dot org 2009-06-11 02:25 -------
CP2K still fails. However, I think I have discovered the root cause. String
constants in formats are saved in the fnode at sting.p which is a pointer.
When we use cached parsed string data, those constant strings are net getting
copied and saved along with the parsed format.
That "constant" string is used by write_constant_string in transfer.c. This is
an issue with the concept because the constant string can vary with each
invocation of the IO statement, as is the case with CP2k, and it is freed at
the end of each IO operation. The benefit of caching is lost if we have to
reparse to find the strings
This leaves the possibility of disabling the caching if a FMT_STRING token is
found while parsing the format the first time. I am going to suggest we revert
format caching from 4.4 right away and probably 4.5 if some better idea does
not pop into my head.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40330