From: Thomas Koenig Date: Mon, 29 Aug 2005 20:40:02 +0000 (+0000) Subject: [multiple changes] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=827afb86298f15371c3d1b3c42fa851470d286f0;p=platform%2Fupstream%2Fgcc.git [multiple changes] 2005-08-29 Thomas Koenig PR libfortran/23598 * io/lock.c(library_start): If ioparm.iostat is present, clear it unconditionally. 2005-02-29 Thomas Koenig PR libfortran/23598 * gfortran.dg/iostat_1.f90: New test. From-SVN: r103613 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5244e71..fa4675b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-02-29 Thomas Koenig + + PR libfortran/23598 + * gfortran.dg/iostat_1.f90: New test. + 2005-08-28 Andrew Pinski PR middle-end/23408 diff --git a/gcc/testsuite/gfortran.dg/iostat_1.f90 b/gcc/testsuite/gfortran.dg/iostat_1.f90 new file mode 100644 index 0000000..79bc001 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/iostat_1.f90 @@ -0,0 +1,14 @@ +! { dg-do run } +! PR 23598 - The iostat variable wasn't reset if the previous +! I/O library call had an error. +program main + implicit none + integer :: ios, i + open (10, pad='no', status='scratch') + write (10, '(A)') '1','1' + rewind (10) + read (10,'(I2)',iostat=ios) i + ios = -4321 + read (10, '(I1)', iostat=ios) i + if (ios /= 0) call abort +end program main diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index e76f9e5..98ae306 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2005-08-29 Thomas Koenig + + PR libfortran/23598 + * io/lock.c(library_start): If ioparm.iostat is present, clear + it unconditionally. + 2005-08-27 Francois-Xavier Coudert * acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Add check to see diff --git a/libgfortran/io/lock.c b/libgfortran/io/lock.c index 9541fc5..7dc08e1 100644 --- a/libgfortran/io/lock.c +++ b/libgfortran/io/lock.c @@ -54,7 +54,7 @@ library_start (void) stay within the library. */ g.in_library = 1; - if (ioparm.iostat != NULL && ioparm.library_return == LIBRARY_OK) + if (ioparm.iostat != NULL) *ioparm.iostat = ERROR_OK; ioparm.library_return = LIBRARY_OK;