From: Steven G. Kargl Date: Wed, 2 Oct 2019 17:09:45 +0000 (+0000) Subject: re PR fortran/91785 (ICE in check_assumed_size_reference, at fortran/resolve.c:1601) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=307de1007192b12dcf5b21b4444904567a543b2e;p=gcc.git re PR fortran/91785 (ICE in check_assumed_size_reference, at fortran/resolve.c:1601) 2019-10-02 Steven G. Kargl PR fortran/91785 * primary.c (gfc_match_varspec): Ensure an inquiry parameter has it locus set. 2019-10-02 Steven G. Kargl PR fortran/91785 * gfortran.dg/pr91785.f90: New test. From-SVN: r276473 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 476973d5cf2..bf8702f2e9d 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2019-10-02 Steven G. Kargl + + PR fortran/91785 + * primary.c (gfc_match_varspec): Ensure an inquiry parameter has + it locus set. + 2019-10-02 Steven G. Kargl PR fortran/91942 diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index e94ea821ba7..7c65b2e604b 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2331,6 +2331,8 @@ gfc_match_varspec (gfc_expr *primary, int equiv_flag, bool sub_flag, if (tmp && tmp->type == REF_INQUIRY) { + if (!primary->where.lb || !primary->where.nextc) + primary->where = gfc_current_locus; gfc_simplify_expr (primary, 0); if (primary->expr_type == EXPR_CONSTANT) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88e4d32695b..cdd99ef0c1d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-10-02 Steven G. Kargl + + PR fortran/91785 + * gfortran.dg/pr91785.f90: New test. + 2019-10-02 Steven G. Kargl PR fortran/91942 diff --git a/gcc/testsuite/gfortran.dg/pr91785.f90 b/gcc/testsuite/gfortran.dg/pr91785.f90 new file mode 100644 index 00000000000..fb3d964fc06 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr91785.f90 @@ -0,0 +1,8 @@ +! { dg-do compile } +! PR fortran/91785 +! Code contributed by Gerhard Steinmetz +program p + complex :: a(*) ! { dg-error "Assumed size array at" } + real :: b(2) + b = a%im ! { dg-error "upper bound in the last dimension" } +end