diff mbox

[Fortran,pr70696/68887,gcc-6,v1] Forgot to commit runtime part

Message ID 20170129161447.359feae0@vepi2
State New
Headers show

Commit Message

Andre Vehreschild Jan. 29, 2017, 3:14 p.m. UTC
Hi all,

during the backport of pr70696 I forgot to backport the runtime part in
libgfortran/caf/single.c. This is fixed by commit r245016.

Sorry for the noise, regards,
	Andre

On Sun, 29 Jan 2017 14:51:03 +0100
Andre Vehreschild <vehre@gmx.de> wrote:

> Hi all,
> 
> just applied the backport to gcc-6 as promised as r245014.
> 
> Regards,
> 	Andre
> 
> On Thu, 19 Jan 2017 16:53:14 +0100
> Andre Vehreschild <vehre@gmx.de> wrote:
> 
> > Hi Steve,
> > 
> > thanks for the review. Committed as r244637.
> > 
> > Regards,
> > 	Andre
> > 
> > On Thu, 19 Jan 2017 06:51:19 -0800
> > Steve Kargl <sgk@troutmask.apl.washington.edu> wrote:
> >   
> > > On Thu, Jan 19, 2017 at 01:07:50PM +0100, Andre Vehreschild wrote:    
> > > > Hi all,
> > > > 
> > > > unfortunately triggered this patch a regression in the opencoarray's
> > > > testsuite, which also occurs outside of opencoarray, when a caf-function
> > > > is used in a block in the main-program. This patch fixes the error and
> > > > adds a testcase.
> > > > 
> > > > Bootstrapped and regtested ok on x86_64-linux/f25. Ok for trunk?
> > > >       
> > > 
> > > Yes.
> > >     
> > 
> >   
> 
>
diff mbox

Patch

Index: libgfortran/caf/single.c
===================================================================
--- libgfortran/caf/single.c	(Revision 245015)
+++ libgfortran/caf/single.c	(Arbeitskopie)
@@ -101,9 +101,12 @@ 
   void *local;
 
   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)
-    local = calloc (size, sizeof (bool));
+      || 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
     local = malloc (size);
   *token = malloc (sizeof (single_token_t));