summaryrefslogtreecommitdiff
path: root/libgfortran/caf
diff options
context:
space:
mode:
authorAndre Vehreschild <vehre@gcc.gnu.org>2017-01-13 11:22:21 +0100
committerAndre Vehreschild <vehre@gcc.gnu.org>2017-01-13 11:22:21 +0100
commit4ccff88b71d7988940c736f123071b11fb614d05 (patch)
tree02a651be289a53ea81ff6fe0d011d7b35f3e8ef2 /libgfortran/caf
parentd8f43ee6d0921b73670e8e123cdd0850dfeb330e (diff)
re PR fortran/70696 ([Coarray] ICE on EVENT POST of host-associated EVENT_TYPE coarray)
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. From-SVN: r244407
Diffstat (limited to 'libgfortran/caf')
-rw-r--r--libgfortran/caf/single.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libgfortran/caf/single.c b/libgfortran/caf/single.c
index cf78a1a48fd..8d3bcbfb80e 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