public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
To: Janne Blomqvist <blomqvist.janne@gmail.com>
Cc: Jerry DeLisle <jvdelisle@charter.net>,
	Fortran List <fortran@gcc.gnu.org>,
	       GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, libfortran] Multi-threaded random_number
Date: Thu, 11 Aug 2016 14:55:00 -0000	[thread overview]
Message-ID: <yddh9ar5pac.fsf@CeBiTec.Uni-Bielefeld.DE> (raw)
In-Reply-To: <CAO9iq9FcHRxPvTS4jbkk=g3Lmrk=NLWUGB5Qn94Sa2ieobn4LQ@mail.gmail.com>	(Janne Blomqvist's message of "Thu, 11 Aug 2016 12:01:59 +0300")

[-- Attachment #1: Type: text/plain, Size: 1254 bytes --]

Hi Janne,

> committed a slightly modified patch as r239356. Changes from the
> submitted patch attached. To my surprise, it turned out that my
> fallback code using __gthread_key_{create,delete} and
> __ghtread_{get,set}_specific was faster than my TLS code, so I removed
> the TLS configure magic and the TLS code and just left the __gthread
> stuff in.

this patch broke Solaris bootstrap:

/vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/random.c: In function 'constructor_random':
/vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/
random.c:915:45: error: 'free' undeclared (first use in this function); did you mean 'frexp'?
     __gthread_key_create (&rand_state_key, &free);
                                             ^~~~
                                             frexp
/vol/gcc/src/hg/trunk/local/libgfortran/intrinsics/random.c:915:45: note: each undeclared identifier is reported only once for each function it appears in

You need to include <stdlib.h> for the free declaration, as this patch
does.  Allowed i386-pc-solaris2.12 and sparc-sun-solaris2.12 to
continue.  I'm going to install this as obvious.

	Rainer


2016-08-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	libgfortran:
	* intrinsics/random.c: Include <stdlib.h>.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: libgfortran-free.patch --]
[-- Type: text/x-patch, Size: 353 bytes --]

diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c
--- a/libgfortran/intrinsics/random.c
+++ b/libgfortran/intrinsics/random.c
@@ -27,6 +27,7 @@ see the files COPYING3 and COPYING.RUNTI
 #include "libgfortran.h"
 #include <gthr.h>
 #include <string.h>
+#include <stdlib.h>
 
 /* For getosrandom.  */
 #ifdef HAVE_SYS_TYPES_H

[-- Attachment #3: Type: text/plain, Size: 143 bytes --]


-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

  reply	other threads:[~2016-08-11 14:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-24 13:45 Janne Blomqvist
2016-08-01 10:42 ` Janne Blomqvist
2016-08-01 10:48   ` Andreas Schwab
2016-08-01 11:00     ` Janne Blomqvist
2016-08-08 11:01 ` Janne Blomqvist
2016-08-09  5:01   ` Jerry DeLisle
2016-08-10 11:12     ` Janne Blomqvist
2016-08-11  9:02       ` Janne Blomqvist
2016-08-11 14:55         ` Rainer Orth [this message]
2016-08-11 15:39           ` Janne Blomqvist
2016-08-12 10:07         ` Thomas Schwinge
2016-08-12 10:37           ` Janne Blomqvist

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yddh9ar5pac.fsf@CeBiTec.Uni-Bielefeld.DE \
    --to=ro@cebitec.uni-bielefeld.de \
    --cc=blomqvist.janne@gmail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jvdelisle@charter.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).