diff options
author | vehre <vehre@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-13 10:22:21 +0000 |
---|---|---|
committer | vehre <vehre@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-01-13 10:22:21 +0000 |
commit | 930cef267870747f06f46597949184a45983efcc (patch) | |
tree | 02a651be289a53ea81ff6fe0d011d7b35f3e8ef2 /libgfortran | |
parent | 99378362755a60c33ff00332ff58e05bc51d9da2 (diff) |
gcc/testsuite/ChangeLog:
2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/70696
* gfortran.dg/coarray/event_3.f08: New test.
gcc/fortran/ChangeLog:
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.
libgfortran/ChangeLog:
2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org>
PR fortran/70696
* caf/single.c (_gfortran_caf_register): Allocate enough memory for
the event counter.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@244407 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/caf/single.c | 7 |
2 files changed, 11 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index f07dff1b8d68..1a687300a78f 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2017-01-13 Andre Vehreschild <vehre@gcc.gnu.org> + + PR fortran/70696 + * caf/single.c (_gfortran_caf_register): Allocate enough memory for + the event counter. + 2017-01-07 Andre Vehreschild <vehre@gcc.gnu.org> PR fortran/78781 diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c index cf78a1a48fdb..8d3bcbfb80ee 100644 --- a/libgfortran/caf/single.c +++ b/libgfortran/caf/single.c @@ -141,9 +141,12 @@ _gfortran_caf_register (size_t size, caf_register_t type, caf_token_t *token, caf_single_token_t single_token; if (type == CAF_REGTYPE_LOCK_STATIC || type == CAF_REGTYPE_LOCK_ALLOC - || type == CAF_REGTYPE_CRITICAL || type == CAF_REGTYPE_EVENT_STATIC - || type == CAF_REGTYPE_EVENT_ALLOC) + || type == CAF_REGTYPE_CRITICAL) local = calloc (size, sizeof (bool)); + else if (type == CAF_REGTYPE_EVENT_STATIC || type == CAF_REGTYPE_EVENT_ALLOC) + /* In the event_(wait|post) function the counter for events is a uint32, + so better allocate enough memory here. */ + local = calloc (size, sizeof (uint32_t)); else if (type == CAF_REGTYPE_COARRAY_ALLOC_REGISTER_ONLY) local = NULL; else |