diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-08-13 18:06:08 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-08-13 18:06:08 +0000 |
commit | 48668ee0d23119ee55f6c844b214342486cc8f1f (patch) | |
tree | ae85fe4b388cf449b2acb83373a957e2b6cdfed0 /gcc/fortran | |
parent | c53bb876f4ca0c7a622f0909772f5b6f23ff5de4 (diff) | |
download | gcc-48668ee0d23119ee55f6c844b214342486cc8f1f.zip gcc-48668ee0d23119ee55f6c844b214342486cc8f1f.tar.gz gcc-48668ee0d23119ee55f6c844b214342486cc8f1f.tar.bz2 |
re PR fortran/87993 (ICE in gfc_constructor_first, at fortran/constructor.c:234)
2019-08-13 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87993
* expr.c (gfc_simplify_expr): Simplifcation of an array with a kind
type inquiry suffix yields a constant expression.
2019-08-13 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/87993
* gfortran.dg/pr87993.f90: New test.
From-SVN: r274388
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/expr.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 7131d0f..d5e44a7 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-08-13 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/87993 + * expr.c (gfc_simplify_expr): Simplifcation of an array with a kind + type inquiry suffix yields a constant expression. + 2019-08-13 Janne Blomqvist <jb@gcc.gnu.org> PR fortran/91414 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 900242d..4516094 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2227,6 +2227,11 @@ gfc_simplify_expr (gfc_expr *p, int type) if (!simplify_ref_chain (p->ref, type, &p)) return false; + /* If the following conditions hold, we found something like kind type + inquiry of the form a(2)%kind while simplify the ref chain. */ + if (p->expr_type == EXPR_CONSTANT && !p->ref && !p->rank && !p->shape) + return true; + if (!simplify_constructor (p->value.constructor, type)) return false; |