diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-12-20 11:35:20 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2019-12-20 12:35:20 +0100 |
commit | de89b5748d68b76b06e3beca4a956060afb79a3d (patch) | |
tree | ff72f1c042fa19182d5953447d3c03b1c2408fdb /gcc/fortran/match.c | |
parent | e565e49fb22cb466dc8af0dc09a061b30806cc04 (diff) | |
download | gcc-de89b5748d68b76b06e3beca4a956060afb79a3d.zip gcc-de89b5748d68b76b06e3beca4a956060afb79a3d.tar.gz gcc-de89b5748d68b76b06e3beca4a956060afb79a3d.tar.bz2 |
Fortran] PR 92996 – fix rank resolution EXPR_ARRAY
PR fortran/92996
gcc/fortran/
* expr.c (simplify_parameter_variable): Call gfc_resolve_ref and
gfc_expression_rank; fix location info.
* gfortran.h (gfc_resolve_ref, gfc_expression_rank): Declare.
* match.c (gfc_match_stopcode): Remove redundant setting of
gfc_init_expr_flag; early return if gfc_simplify_expr has an error.
* resolve.c (gfc_expression_rank): Renamed from expression_rank;
minor cleanup.
(gfc_resolve_ref): Removed static and renamed from resolve_ref.
(resolve_variable, resolve_typebound_function,
resolve_typebound_subroutine, resolve_ppc_call, resolve_expr_ppc,
gfc_resolve_expr, resolve_procedure): Update calls.
PR fortran/92996
gcc/testsuite/
* gfortran.dg/array_simplify_4.f90: New.
* gfortran.dg/pr91565.f90: Update dg-error.
* gfortran.dg/pr91801.f90: Likewise.
From-SVN: r279638
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index b594504..d3e3abc 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -3073,7 +3073,8 @@ gfc_match_stopcode (gfc_statement st) if (e != NULL) { - gfc_simplify_expr (e, 0); + if (!gfc_simplify_expr (e, 0)) + goto cleanup; /* Test for F95 and F2003 style STOP stop-code. */ if (e->expr_type != EXPR_CONSTANT && (f95 || f03)) @@ -3085,9 +3086,7 @@ gfc_match_stopcode (gfc_statement st) /* Use the machinery for an initialization expression to reduce the stop-code to a constant. */ - gfc_init_expr_flag = true; gfc_reduce_init_expr (e); - gfc_init_expr_flag = false; /* Test for F2008 style STOP stop-code. */ if (e->expr_type != EXPR_CONSTANT && f08) |