diff options
author | Andre Vehreschild <vehre@gcc.gnu.org> | 2017-01-13 11:39:52 +0100 |
---|---|---|
committer | Andre Vehreschild <vehre@gcc.gnu.org> | 2017-01-13 11:39:52 +0100 |
commit | eaed322611b9c09a746f84e6280cdd400aaf9d60 (patch) | |
tree | 5e3e02429a05e3e3aa17d66824a6d5b9fcfacb8a | |
parent | 3603fa5cfb32ced1402f31b174a3023826745160 (diff) | |
download | gcc-eaed322611b9c09a746f84e6280cdd400aaf9d60.zip gcc-eaed322611b9c09a746f84e6280cdd400aaf9d60.tar.gz gcc-eaed322611b9c09a746f84e6280cdd400aaf9d60.tar.bz2 |
re PR fortran/70697 ([Coarray] ICE on EVENT WAIT with array element UNTIL_COUNT argument)
gcc/testsuite/ChangeLog:
2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/70697
* gfortran.dg/coarray/event_4.f08: New test.
gcc/fortran/ChangeLog:
2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/70697
* resolve.c (resolve_lock_unlock_event): Resolve the expression for
event's until_count.
From-SVN: r244413
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/resolve.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/coarray/event_4.f08 | 12 |
4 files changed, 30 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index e979a30..191bfc8 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org> + PR fortran/70697 + * resolve.c (resolve_lock_unlock_event): Resolve the expression for + event's until_count. + +2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org> + PR fortran/70696 * trans-expr.c (gfc_get_tree_for_caf_expr): Ensure the backend_decl is valid before accessing it. diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c index a75d5fe..a5fe231 100644 --- a/gcc/fortran/resolve.c +++ b/gcc/fortran/resolve.c @@ -9158,10 +9158,13 @@ resolve_lock_unlock_event (gfc_code *code) return; /* Check for EVENT WAIT the UNTIL_COUNT. */ - if (code->op == EXEC_EVENT_WAIT && code->expr4 - && (code->expr4->ts.type != BT_INTEGER || code->expr4->rank != 0)) - gfc_error ("UNTIL_COUNT= argument at %L must be a scalar INTEGER " - "expression", &code->expr4->where); + if (code->op == EXEC_EVENT_WAIT && code->expr4) + { + if (!gfc_resolve_expr (code->expr4) || code->expr4->ts.type != BT_INTEGER + || code->expr4->rank != 0) + gfc_error ("UNTIL_COUNT= argument at %L must be a scalar INTEGER " + "expression", &code->expr4->where); + } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index df14a1b..3a6fcfc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org> + PR fortran/70697 + * gfortran.dg/coarray/event_4.f08: New test. + +2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org> + PR fortran/70696 * gfortran.dg/coarray/event_3.f08: New test. diff --git a/gcc/testsuite/gfortran.dg/coarray/event_4.f08 b/gcc/testsuite/gfortran.dg/coarray/event_4.f08 new file mode 100644 index 0000000..de901c0 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/coarray/event_4.f08 @@ -0,0 +1,12 @@ +! { dg-do run } +! +! Check that pr 70697 is fixed. + +program event_4 + use iso_fortran_env + integer :: nc(1) + type(event_type) done[*] + nc(1) = 1 + event post(done[1]) + event wait(done,until_count=nc(1)) +end |