diff options
author | Linus Koenig <link@sig-st.de> | 2020-04-13 16:30:44 +0200 |
---|---|---|
committer | Thomas König <tkoenig@gcc.gnu.org> | 2020-04-13 16:32:38 +0200 |
commit | efbf7392079222ef00db2d39998faf5513055181 (patch) | |
tree | 0a4017806092556e4a00f0199d04f98abd8883da /gcc/fortran/simplify.c | |
parent | 8d213cbbe1856e6088282aa0076646cec694b030 (diff) | |
download | gcc-efbf7392079222ef00db2d39998faf5513055181.zip gcc-efbf7392079222ef00db2d39998faf5513055181.tar.gz gcc-efbf7392079222ef00db2d39998faf5513055181.tar.bz2 |
ICE on wrong code [PR94192].
The idea is not have another resolution of a pointer if an error has
occurred previously.
2020-04-13 Linus Koenig <link@sig-st.de>
PR fortran/94192
* resolve.c (resolve_fl_var_and_proc): Set flag "error" to 1 if
pointer is found to not have an assumed rank or a deferred shape.
* simplify.c (simplify_bound): If an error has been issued for a
given pointer, one should not attempt to find its bounds.
2020-04-13 Linus Koenig <link@sig-st.de>
PR fortran/94192
* gfortran.dg/bound_resolve_after_error_1.f90: New test.
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r-- | gcc/fortran/simplify.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index f63f63c..807565b 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -4159,6 +4159,10 @@ simplify_bound (gfc_expr *array, gfc_expr *dim, gfc_expr *kind, int upper) gfc_array_spec *as; int d; + /* Do not attempt to resolve if error has already been issued. */ + if (array->symtree && array->symtree->n.sym->error) + return NULL; + if (array->ts.type == BT_CLASS) return NULL; |