+2016-02-27 Alessandro Fanfarillo <fanfarillo.gcc@gmail.com>
+
+ * trans.c (gfc_allocate_allocatable): size conversion
+ from byte to number of elements for event variables.
+ * trans-types.c (gfc_get_derived_type): event variables
+ represented as a pointer (like lock variable).
+
2016-02-23 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/61156
if (derived->attr.unlimited_polymorphic
|| (flag_coarray == GFC_FCOARRAY_LIB
&& derived->from_intmod == INTMOD_ISO_FORTRAN_ENV
- && derived->intmod_sym_id == ISOFORTRAN_LOCK_TYPE))
+ && (derived->intmod_sym_id == ISOFORTRAN_LOCK_TYPE
+ || derived->intmod_sym_id == ISOFORTRAN_EVENT_TYPE)))
return ptr_type_node;
if (flag_coarray != GFC_FCOARRAY_LIB
the FE only passes the pointer around and leaves the actual
representation to the library. Hence, we have to convert back to the
number of elements. */
- if (lock_var)
+ if (lock_var || event_var)
size = fold_build2_loc (input_location, TRUNC_DIV_EXPR, size_type_node,
size, TYPE_SIZE_UNIT (ptr_type_node));