gcc/libgfortran
Janne Blomqvist f4c0f88881 Make recursion_check work for multiple threads
With multiple threads, using an unprotected static variable to check
whether recursion has occured isn't valid, as one thread might have
modified the variable, thus causing another thread to incorrectly
conclude that recursion has occured.  This patch avoids this problem
by using a thread-specific variable for the recursion check.

Regtested on x86_64-pc-linux-gnu.

libgfortran/ChangeLog:

2018-11-23  Janne Blomqvist  <jb@gcc.gnu.org>

	* runtime/error.c (MAGIC): Remove.
	(recursion_key): New variable.
	(recursion_check): Use thread-specific variable for recursion
	check if threads are active.
	(constructor_recursion_check): New function.
	(destructor_recursion_check): New funcion.

From-SVN: r266419
2018-11-23 22:42:03 +02:00
..
caf PR 84519 Handle optional QUIET specifier for STOP and ERROR STOP 2018-02-23 11:07:24 +02:00
config Update copyright years. 2018-01-03 11:03:58 +01:00
generated re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-10-28 11:05:05 +00:00
ieee Update copyright years. 2018-01-03 11:03:58 +01:00
intrinsics Include <sys/random.h> for getentropy on Solaris 2018-08-14 22:51:36 +00:00
io Replace sync builtins with atomic builtins 2018-11-22 09:58:29 +02:00
m4 re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-10-28 11:05:05 +00:00
runtime Make recursion_check work for multiple threads 2018-11-23 22:42:03 +02:00
ChangeLog Make recursion_check work for multiple threads 2018-11-23 22:42:03 +02:00
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017 Update copyright years. 2018-01-03 11:03:58 +01:00
Makefile.am Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
Makefile.in Replace sync builtins with atomic builtins 2018-11-22 09:58:29 +02:00
acinclude.m4 Replace sync builtins with atomic builtins 2018-11-22 09:58:29 +02:00
aclocal.m4 Update GCC to autoconf 2.69, automake 1.15.1 (PR bootstrap/82856). 2018-10-31 17:03:16 +00:00
c99_protos.h Update copyright years. 2018-01-03 11:03:58 +01:00
config.h.in Replace sync builtins with atomic builtins 2018-11-22 09:58:29 +02:00
configure Replace sync builtins with atomic builtins 2018-11-22 09:58:29 +02:00
configure.ac Replace sync builtins with atomic builtins 2018-11-22 09:58:29 +02:00
configure.host
gfortran.map re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-10-28 11:05:05 +00:00
kinds-override.h Update copyright years. 2018-01-03 11:03:58 +01:00
libgfortran.h re PR fortran/54613 ([F08] Add FINDLOC plus support MAXLOC/MINLOC with KIND=/BACK=) 2018-10-28 11:05:05 +00:00
libgfortran.spec.in
libtool-version
mk-kinds-h.sh
mk-sik-inc.sh
mk-srk-inc.sh