diff options
author | Feng Wang <fengwang@nudt.edu.cn> | 2005-03-15 02:52:38 +0000 |
---|---|---|
committer | Feng Wang <fengwang@gcc.gnu.org> | 2005-03-15 02:52:38 +0000 |
commit | ce2df7c64ae0185dab22bb38628acf8ae48551b7 (patch) | |
tree | 9d626c10efe2ea1ff72bf8bd94fa123c776b3dad /gcc/fortran/io.c | |
parent | 08091139067ee2565a3ad248bd0113e521a425ee (diff) | |
download | gcc-ce2df7c64ae0185dab22bb38628acf8ae48551b7.zip gcc-ce2df7c64ae0185dab22bb38628acf8ae48551b7.tar.gz gcc-ce2df7c64ae0185dab22bb38628acf8ae48551b7.tar.bz2 |
re PR fortran/18827 (ICE on assign to common variable)
fortran/
2005-03-15 Feng Wang <fengwang@nudt.edu.cn>
PR fortran/18827
* io.c (resolve_tag): Add checking on assigned label.
(match_dt_format): Does not set symbol assign attribute.
* match.c (gfc_match_goto):Does not set symbol assign attribute.
* resolve.c (resolve_code): Add checking on assigned label.
* trans-common.c (build_field): Deals with common variable assigned
a label.
* trans-stmt.c (gfc_conv_label_variable): New function.
(gfc_trans_label_assign): Use it.
(gfc_trans_goto): Ditto.
* trans-io.c (set_string): Ditto.
* trans.h (gfc_conv_label_variable): Add prototype.
testsuite/
2005-03-15 Feng Wang <fengwang@nudt.edu.cn>
PR fortran/18827
* gfortran.dg/assign_2.f90: New test.
* gfortran.dg/assign_3.f90: New test.
* gfortran.dg/assign.f90: New test.
From-SVN: r96467
Diffstat (limited to 'gcc/fortran/io.c')
-rw-r--r-- | gcc/fortran/io.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 8230fa9..12650f9 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -981,6 +981,14 @@ resolve_tag (const io_tag * tag, gfc_expr * e) &e->where); return FAILURE; } + /* Check assigned label. */ + if (e->expr_type == EXPR_VARIABLE && e->ts.type == BT_INTEGER + && e->symtree->n.sym->attr.assign != 1) + { + gfc_error ("Variable '%s' has not been assigned a format label at %L", + e->symtree->n.sym->name, &e->where); + return FAILURE; + } } else { @@ -1526,9 +1534,6 @@ match_dt_format (gfc_dt * dt) gfc_free_expr (e); goto conflict; } - if (e->ts.type == BT_INTEGER && e->rank == 0) - e->symtree->n.sym->attr.assign = 1; - dt->format_expr = e; return MATCH_YES; } |