+2012-09-29 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/52724
+ * gfortran.dg/internal_readwrite_3.f90: New test.
+
2012-09-28 Dodji Seketeli <dodji@redhat.com>
* g++.dg/warn/Wunused-local-typedefs-3.C: Move the c++-only test
--- /dev/null
+! { dg-do run }
+! PR 52724 - this used to generate a "Bad integer" error.
+program main
+ implicit none
+ integer :: i
+ character(len=100,kind=4) :: buffer, a
+ buffer = 4_"123"
+ read(buffer,*) i
+ write (a,'(I3)') i
+ if (a /= 4_"123") call abort
+end program main
+2012-09-29 Thomas König <tkoenig@gcc.gnu.org>
+
+ PR fortran/52724
+ * list_read.c (next_char): Handle kind=4 characters.
+ * unix.c (open_internal4): Correct lenth of internal file.
+
2012-09-14 David Edelsohn <dje.gcc@gmail.com>
* configure: Regenerated.
if (is_internal_unit (dtp))
{
- char cc;
- length = sread (dtp->u.p.current_unit->s, &cc, 1);
- c = cc;
+ /* Check for kind=4 internal unit. */
+ if (dtp->common.unit)
+ length = sread (dtp->u.p.current_unit->s, &c, sizeof (gfc_char4_t));
+ else
+ {
+ char cc;
+ length = sread (dtp->u.p.current_unit->s, &cc, 1);
+ c = cc;
+ }
+
if (length < 0)
{
generate_error (&dtp->common, LIBERROR_OS, NULL);
s->buffer = base;
s->buffer_offset = offset;
- s->active = s->file_length = length;
+ s->active = s->file_length = length * sizeof (gfc_char4_t);
s->st.vptr = &mem4_vtable;