diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-10-13 13:42:30 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2019-10-13 13:42:30 +0000 |
commit | 19400cb96ce8fde3268d0b476d4d3c1efe3d3728 (patch) | |
tree | 02b5e02b1b6ad8df0c5496d920e7e438ef6d7f4c /gcc/fortran/expr.c | |
parent | 855c21cb9af3e00ac10533f0525b038cf77eaa49 (diff) | |
download | gcc-19400cb96ce8fde3268d0b476d4d3c1efe3d3728.zip gcc-19400cb96ce8fde3268d0b476d4d3c1efe3d3728.tar.gz gcc-19400cb96ce8fde3268d0b476d4d3c1efe3d3728.tar.bz2 |
re PR fortran/92017 (ICE in gfc_expr_attr, at fortran/primary.c:2674)
2019-10-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92017
* expr.c (simplify_parameter_variable): Set the character length
of the result expression from the original expression if
necessary.
2019-10-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/92017
* gfortran.dg/minmaxloc_14.f90: New test.
From-SVN: r276938
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 9f638fe..c508890 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2066,6 +2066,9 @@ simplify_parameter_variable (gfc_expr *p, int type) e->rank = p->rank; + if (e->ts.type == BT_CHARACTER && e->ts.u.cl == NULL) + e->ts.u.cl = gfc_new_charlen (gfc_current_ns, p->ts.u.cl); + /* Do not copy subobject refs for constant. */ if (e->expr_type != EXPR_CONSTANT && p->ref != NULL) e->ref = gfc_copy_ref (p->ref); |