From 31b6f11ab0530374184676979781ba81b06ae38f Mon Sep 17 00:00:00 2001 From: Bud Davis Date: Wed, 9 Jun 2004 00:55:04 +0000 Subject: [PATCH] re PR libfortran/15755 (gfortran: backspace call causes bus error) 2004-06-08 Bud Davis PR gfortran/15755 * gfortran.fortran-torture/execute/backspace.c : New test. * io/backspace.c(st_backspace): call correct routine for formatted and un-formatted units. From-SVN: r82806 --- gcc/testsuite/ChangeLog | 5 +++++ .../gfortran.fortran-torture/execute/backspace.f90 | 14 ++++++++++++++ libgfortran/ChangeLog | 6 ++++++ libgfortran/io/backspace.c | 2 +- 4 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gfortran.fortran-torture/execute/backspace.f90 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 175edd483a3..00f5518815a 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-06-09 Bud Davis + + PR gfortran/15755 + * gfortran.fortran-torture/execute/backspace.c : New test. + 2004-06-09 Paul Brook * gfortran.fortran-torture/execure/intrinsic_associated.f90 diff --git a/gcc/testsuite/gfortran.fortran-torture/execute/backspace.f90 b/gcc/testsuite/gfortran.fortran-torture/execute/backspace.f90 new file mode 100644 index 00000000000..16f5523e353 --- /dev/null +++ b/gcc/testsuite/gfortran.fortran-torture/execute/backspace.f90 @@ -0,0 +1,14 @@ +! pr 15755 + implicit none + character*1 C + open(10) + write(10,*)'a' + write(10,*)'b' + write(10,*)'c' + rewind(10) + read(10,*)C + backspace(10) + read(10,*) C + if (C.ne.'b') call abort + close(10,STATUS='DELETE') + end diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index d67ee65e0b3..ab7d37633db 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2004-06-09 Bud Davis + + PR gfortran/15755 + * io/backspace.c(st_backspace): call correct routine for + formatted and un-formatted units. + 2004-05-30 Andreas Jaeger , Steven Bosscher PR gfortran/11800 diff --git a/libgfortran/io/backspace.c b/libgfortran/io/backspace.c index aff4c5e29e3..c40e506c876 100644 --- a/libgfortran/io/backspace.c +++ b/libgfortran/io/backspace.c @@ -149,7 +149,7 @@ st_backspace (void) if (file_position (u->s) == 0) goto done; /* Common special case */ - if (u->flags.form == FORM_UNFORMATTED) + if (u->flags.form == FORM_FORMATTED) formatted_backspace (); else unformatted_backspace (); -- 2.30.2