]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Right size for events
authorAlessandro Fanfarillo <fanfarillo.gcc@gmail.com>
Sat, 27 Feb 2016 11:57:16 +0000 (04:57 -0700)
committerAlessandro Fanfarillo <afanfa@gcc.gnu.org>
Sat, 27 Feb 2016 11:57:16 +0000 (04:57 -0700)
From-SVN: r233779

gcc/fortran/ChangeLog
gcc/fortran/trans-types.c
gcc/fortran/trans.c

index 661479302f4807ea1517dd972eca3ad0d74afd30..5f1bc4f497f4eb3868f9a4130d6820fc31a7611b 100644 (file)
@@ -1,3 +1,10 @@
+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
index f3d084194de1f037f838a1a08c20a211e48133d2..a71cf0bcd27a0346f3f8b7bf9436849e4bbbaa4a 100644 (file)
@@ -2370,7 +2370,8 @@ gfc_get_derived_type (gfc_symbol * derived)
   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
index e71430baeb88c93f3915255607a03ef7d3fda1cf..c6688d351a790e76b37aa5c359cdfeccd842ef5d 100644 (file)
@@ -820,7 +820,7 @@ gfc_allocate_allocatable (stmtblock_t * block, tree mem, tree size, tree token,
         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));