diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-09-04 23:21:12 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-09-04 23:21:12 +0000 |
commit | 4844a5cb8c37e84eb742471a52dc927ac5cdd16d (patch) | |
tree | ab5bea8c9a813eebeb3e60df53412cc4081db095 /gcc/fortran/io.c | |
parent | ad4d1d21ad5c515ba90355d13b14cbb74262edd2 (diff) | |
download | gcc-4844a5cb8c37e84eb742471a52dc927ac5cdd16d.zip gcc-4844a5cb8c37e84eb742471a52dc927ac5cdd16d.tar.gz gcc-4844a5cb8c37e84eb742471a52dc927ac5cdd16d.tar.bz2 |
re PR fortran/91650 (ICE in gfc_conv_constant_to_tree, at fortran/trans-const.c:370)
2019-09-04 Steven G. Kargl <kargl@gcvc.gnu.org>
PR fortran/91650
* io.c (match_io_element): An output IO list item cannot be a BOZ.
2019-09-04 Steven G. Kargl <kargl@gcvc.gnu.org>
PR fortran/91650
* gfortran.dg/pr91650_1.f90: New test.
* gfortran.dg/pr91650_2.f90: Ditto.
From-SVN: r275391
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 632e168..d57b747 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -3675,6 +3675,15 @@ match_io_element (io_kind k, gfc_code **cpp) if (m == MATCH_NO) gfc_error ("Expected expression in %s statement at %C", io_kind_name (k)); + + if (m == MATCH_YES && expr->ts.type == BT_BOZ) + { + if (gfc_invalid_boz ("BOZ literal constant at %L cannot appear in " + "an output IO list", &gfc_current_locus)) + return MATCH_ERROR; + if (!gfc_boz2int (expr, gfc_max_integer_kind)) + return MATCH_ERROR; + }; } if (m == MATCH_YES && k == M_READ && gfc_check_do_variable (expr->symtree)) |