[Bug fortran/53796] I/O INQUIRE of RECL: If not specified in OPEN, the default value should be returned (sequential access)

jvdelisle at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jun 30 01:35:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53796

--- Comment #11 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2012-06-30 01:35:12 UTC ---
Maybe a new PR for this is in order.

gdb output with test case in Comment #9

(gdb) 
634      if (flags->form == FORM_FORMATTED)
(gdb) 
636          if ((opp->common.flags & IOPARM_OPEN_HAS_RECL_IN))
(gdb) 
637            fbuf_init (u, u->recl);
(gdb) 
_gfortrani_fbuf_init (u=u@entry=0x6eea60, len=-1)
    at ../../../trunk/libgfortran/io/fbuf.c:38
38    {
(gdb) 
39      if (len == 0)
(gdb) 
38    {
(gdb) 
39      if (len == 0)
(gdb) 
42      u->fbuf = xmalloc (sizeof (struct fbuf));
(gdb) 
_gfortrani_xmalloc (n=n@entry=24)
    at ../../../trunk/libgfortran/runtime/memory.c:33
33    {
(gdb) 

I need to peak at u-recl to see what it is here.
37        n = 1;
(gdb) 
39      p = malloc (n);
(gdb) 
41      if (p == NULL)
(gdb) 
45    }
(gdb) 
_gfortrani_fbuf_init (u=u@entry=0x6eea60, len=-1)
    at ../../../trunk/libgfortran/io/fbuf.c:43
43      u->fbuf->buf = xmalloc (len);
(gdb) 
42      u->fbuf = xmalloc (sizeof (struct fbuf));
(gdb) 
43      u->fbuf->buf = xmalloc (len);
(gdb) 
_gfortrani_xmalloc (n=n@entry=18446744073709551615)
    at ../../../trunk/libgfortran/runtime/memory.c:33
33    {
(gdb) 
37        n = 1;
(gdb) 
39      p = malloc (n);
(gdb) 
41      if (p == NULL)
(gdb) 
42        os_error ("Memory allocation failed");
(gdb) 
_gfortrani_os_error (message=message@entry=0x4b6a6d "Memory allocation failed")
    at ../../../trunk/libgfortran/runtime/error.c:294
294    {
(gdb)



More information about the Gcc-bugs mailing list