diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-05-24 22:28:33 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2018-05-24 22:28:33 +0000 |
commit | 8909fee2891ba084a2b8d317e864b3cf4c1e6b01 (patch) | |
tree | 99d3fcbc18670b7c850e4d99d0aa38634368171a /gcc | |
parent | 91294f1e4f26a737ea8f747bb410d28a36ce0285 (diff) | |
download | gcc-8909fee2891ba084a2b8d317e864b3cf4c1e6b01.zip gcc-8909fee2891ba084a2b8d317e864b3cf4c1e6b01.tar.gz gcc-8909fee2891ba084a2b8d317e864b3cf4c1e6b01.tar.bz2 |
re PR fortran/85895 (ICE in gfc_conv_array_ref, at fortran/trans-array.c:3518)
2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85895
* resolve.c (resolve_sync): Resolve expression before checking for
an error.
2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/85895
* gfortran.dg/coarray_3.f90: Fix invalid testcase.
* gfortran.dg/pr85895.f90: New test.
From-SVN: r260696
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray_3.f90 | 2 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/pr85895.f90 | 17 |
5 files changed, 33 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 00abe73..a65470c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/85895 + * resolve.c (resolve_sync): Resolve expression before checking for + an error. + 2018-05-22 Janus Weil <janus@gcc.gnu.org> PR fortran/85841 diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index 13374dd..a53253ea 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -9527,6 +9527,7 @@ resolve_sync (gfc_code *code) } /* Check STAT. */ + gfc_resolve_expr (code->expr2); if (code->expr2 && (code->expr2->ts.type != BT_INTEGER || code->expr2->rank != 0 || code->expr2->expr_type != EXPR_VARIABLE)) @@ -9534,6 +9535,7 @@ resolve_sync (gfc_code *code) &code->expr2->where); /* Check ERRMSG. */ + gfc_resolve_expr (code->expr3); if (code->expr3 && (code->expr3->ts.type != BT_CHARACTER || code->expr3->rank != 0 || code->expr3->expr_type != EXPR_VARIABLE)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 4e77177..707db42 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-05-24 Steven G. Kargl <kargl@gcc.gnu.org> + + PR fortran/85895 + + * gfortran.dg/coarray_3.f90: Fix invalid testcase. + * gfortran.dg/pr85895.f90: New test. + 2018-05-24 Uros Bizjak <ubizjak@gmail.com> * gcc.target/i386/avx512f-vcvtusi2sd64-1.c: Update scan string. diff --git a/gcc/testsuite/gfortran.dg/coarray_3.f90 b/gcc/testsuite/gfortran.dg/coarray_3.f90 index aba4eb1..d152ce1 100644 --- a/gcc/testsuite/gfortran.dg/coarray_3.f90 +++ b/gcc/testsuite/gfortran.dg/coarray_3.f90 @@ -13,7 +13,7 @@ end critical fkl ! { dg-error "Expecting END PROGRAM" } sync all (stat=1) ! { dg-error "Syntax error in SYNC ALL" } sync all ( stat = n,stat=k) ! { dg-error "Redundant STAT" } -sync memory (errmsg=str) +sync memory (errmsg=str) ! { dg-error "must be a scalar CHARACTER variable" } sync memory (errmsg=n) ! { dg-error "must be a scalar CHARACTER variable" } sync images (*, stat=1.0) ! { dg-error "Syntax error in SYNC IMAGES" } sync images (-1) ! { dg-error "must between 1 and num_images" } diff --git a/gcc/testsuite/gfortran.dg/pr85895.f90 b/gcc/testsuite/gfortran.dg/pr85895.f90 new file mode 100644 index 0000000..184266e --- /dev/null +++ b/gcc/testsuite/gfortran.dg/pr85895.f90 @@ -0,0 +1,17 @@ +! { dg-do compile } +! { dg-options "-fcoarray=lib" } +! PR fortran/85895 +subroutine p + character(80) :: c(2) + sync memory (errmsg=c) ! { dg-error "scalar CHARACTER variable" } +end subroutine p + +subroutine q + character(80) :: c(2) + sync memory (errmsg=c(1:2)) ! { dg-error "scalar CHARACTER variable" } +end subroutine q + +subroutine r + character(80) :: c(2) + sync memory (errmsg=c(1)) +end subroutine r |