diff options
author | Tobias Burnus <tobias@codesourcery.com> | 2019-10-11 13:41:13 +0000 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2019-10-11 15:41:13 +0200 |
commit | 643d443665ec68270af4c950fed4cdc1adad5154 (patch) | |
tree | 55ae95c7860333fa1516368b1068408792e7af6c /gcc/fortran/trans-expr.c | |
parent | 1284e2b104a81ad93daab5110cd844981e501086 (diff) | |
download | gcc-643d443665ec68270af4c950fed4cdc1adad5154.zip gcc-643d443665ec68270af4c950fed4cdc1adad5154.tar.gz gcc-643d443665ec68270af4c950fed4cdc1adad5154.tar.bz2 |
Fortran] PR 92050 - fix ICE with -fcheck=all
gcc/fortran/
PR fortran/92050
* trans-expr.c (gfc_conv_procedure_call): Handle code generated
by -fcheck=all.
gcc/testsuite/
PR fortran/92050
* gfortran.dg/pr92050.f90: New.
From-SVN: r276885
Diffstat (limited to 'gcc/fortran/trans-expr.c')
-rw-r--r-- | gcc/fortran/trans-expr.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 965ab77..65238ff 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -7031,8 +7031,11 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym, gfc_allocate_lang_decl (result); GFC_DECL_SAVED_DESCRIPTOR (result) = parmse.expr; gfc_free_expr (class_expr); - gcc_assert (parmse.pre.head == NULL_TREE - && parmse.post.head == NULL_TREE); + /* -fcheck= can add diagnostic code, which has to be placed before + the call. */ + if (parmse.pre.head != NULL) + gfc_add_expr_to_block (&se->pre, parmse.pre.head); + gcc_assert (parmse.post.head == NULL_TREE); } /* Follow the function call with the argument post block. */ |