read.c (read_f): Convert assert to runtime error.

2013-12-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	* io/read.c (read_f): Convert assert to runtime error.

2013-12-18  Steven G. Kargl  <kargl@gcc.gnu.org>

	* gfortran.dg/io_err_1.f90: New test.

From-SVN: r206102
This commit is contained in:
Steven G. Kargl 2013-12-18 23:41:50 +00:00
parent 7289d1c977
commit 7b6b435332
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2013-12-18 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/io_err_1.f90: New test.
2013-12-18 Balaji V. Iyer <balaji.v.iyer@intel.com>
* c-c++-common/cilk-plus/SE/ef_test.c: New test.

View File

@ -0,0 +1,14 @@
! { dg-do run }
! { dg-shouldfail "Compile-time specifier checking" }
!
! Contributed by Dominique Dhumieres <dominiq at lps dot ens dot fr>
program read
character(50) :: buf='0.D99999'
double precision val
read (UNIT=buf, FMT='(D60.0)', ERR=10) Val
call abort
10 read (UNIT=buf, FMT='(D60.0)') Val
end program read
! { dg-output "At line 10 of file.*" }
! { dg-output "Fortran runtime error: Bad value during floating point read" }

View File

@ -1,3 +1,7 @@
2013-12-18 Steven G. Kargl <kargl@gcc.gnu.org>
* io/read.c (read_f): Convert assert to runtime error.
2013-12-17 Andreas Tobler <andreast@gcc.gnu.org>
* io/unix.c (tempfile_open): Only use the needed flag O_CLOEXEC.

View File

@ -1150,7 +1150,9 @@ done:
exponent = - exponent;
}
assert (exponent < 10000);
if (exponent >= 10000)
goto bad_float;
for (dig = 3; dig >= 0; --dig)
{
out[dig] = (char) ('0' + exponent % 10);