public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/52724] New: Internal read with character(kind=4) data
@ 2012-03-26 13:10 tkoenig at gcc dot gnu.org
  2012-03-26 16:25 ` [Bug fortran/52724] " tkoenig at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: tkoenig at gcc dot gnu.org @ 2012-03-26 13:10 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52724
           Summary: Internal read with character(kind=4) data
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: tkoenig@gcc.gnu.org


This code in io/unit.c looks fishy:

  /* Set initial values for unit parameters.  */
  if (dtp->common.unit)
    {
      iunit->s = open_internal4 (dtp->internal_unit - start_record,
                 dtp->internal_unit_len, -start_record);
      fbuf_init (iunit, 256);
    }
  else
    iunit->s = open_internal (dtp->internal_unit - start_record,
                  dtp->internal_unit_len, -start_record);

because it supposes that an internal unit for character(kind=4) data
has an internal unit number which is unequal to zero.

And, in fact, this fails:

ig25@linux-fd1f:~/Krempel/Opt> cat foo.f90
!234567
      character buffer4(100)
      integer i

      buffer4 = 4_'123'
      read(buffer4,*) i
      print *,i
      end
ig25@linux-fd1f:~/Krempel/Opt> gfortran foo.f90
ig25@linux-fd1f:~/Krempel/Opt> ./a.out
           1


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-10-28 20:51 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-26 13:10 [Bug fortran/52724] New: Internal read with character(kind=4) data tkoenig at gcc dot gnu.org
2012-03-26 16:25 ` [Bug fortran/52724] " tkoenig at gcc dot gnu.org
2012-03-29  1:44 ` jvdelisle at gcc dot gnu.org
2012-04-02 20:01 ` burnus at gcc dot gnu.org
2012-04-08  8:55 ` tkoenig at gcc dot gnu.org
2012-09-24 18:07 ` tkoenig at gcc dot gnu.org
2012-09-29 17:39 ` tkoenig at gcc dot gnu.org
2012-10-28 20:51 ` tkoenig at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).