------- Comment #6 from fxcoudert at gcc dot gnu dot org 2005-12-10 16:39 ------- I found the problem in the second one, which is fixed by the one-line patch:
Index: io/file_pos.c =================================================================== --- io/file_pos.c (revision 108353) +++ io/file_pos.c (working copy) @@ -109,13 +109,14 @@ length = sizeof (gfc_offset); - p = salloc_r_at (u->s, &length, - file_position (u->s) - length); + /* length is modified by this function call, and most probably + set to zero. */ + p = salloc_r_at (u->s, &length, file_position (u->s) - length); if (p == NULL) goto io_error; memcpy (&m, p, sizeof (gfc_offset)); - new = file_position (u->s) - m - 2*length; + new = file_position (u->s) - m - sizeof (gfc_offset) - length; if (sseek (u->s, new) == FAILURE) goto io_error; (well, more than one line since I added a comment so that we don't do this mistake again). Since this does not fixed the other problem, I filed it separately under PR 25340. -- fxcoudert at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- AssignedTo|unassigned at gcc dot gnu |fxcoudert at gcc dot gnu dot |dot org |org Status|NEW |ASSIGNED Keywords| |patch Last reconfirmed|2005-12-10 15:39:19 |2005-12-10 16:39:26 date| | Target Milestone|--- |4.1.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25139