re PR c++/13684 (local static object variable constructed once but ctors and dtors called multiple times on same memory when called in multiple threads)
PR c++/13684
* cp/decl.c (expand_static_init): Use thread-safety API.
(register_dtor_fn): Return the call, don't expand it.
* cp/tree.c (add_stmt_to_compound): New fn.
(stabilize_call): Use it.
* gimplify.c (gimplify_cleanup_point_expr): Handle CLEANUP_EH_ONLY.
(gimple_push_cleanup): Add eh_only parm.
(gimplify_target_expr): Pass it.
* c.opt (-fno-threadsafe-statics): New option.
* c-opts.c (c_common_handle_option): Handle it.
* c-common.h (flag_threadsafe_statics): Declare it.
* c-common.c (flag_threadsafe_statics): Record it.
* doc/invoke.texi: Document it.
* tsystem.h (_GNU_SOURCE): Define.
* gthr-posix.h (__gthread_recursive_mutex_t): New typedef.
(__GTHREAD_RECURSIVE_MUTEX_INIT): New macro.
(__GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION): New macro.
(__gthread_recursive_mutex_init_function): New fn.
(__gthread_recursive_mutex_lock): New fn.
(__gthread_recursive_mutex_trylock): New fn.
(__gthread_recursive_mutex_unlock): New fn.
* gthr-solaris.h, gthr-single.h, gthr-dce.h: Likewise.
* gthr-win32.h, gthr-vxworks.h: Likewise.
* gthr.h: Document.
* libsupc++/guard.cc (static_mutex): Internal class implementing a
recursive mutex which controls initialization of local statics.
(__gnu_cxx::recursive_init): New exception class.
(__cxa_guard_acquire): Deal with locking and recursion detection.
(acquire_1, __cxa_guard_abort, __cxa_guard_release): Likewise.
From-SVN: r86687
| Name |
Last commit
|
Last update |
|---|---|---|
| .. | ||
| athlon.md | Loading commit data... | |
| att.h | Loading commit data... | |
| beos-elf.h | Loading commit data... | |
| biarch64.h | Loading commit data... | |
| bsd.h | Loading commit data... | |
| crtdll.h | Loading commit data... | |
| cygming.h | Loading commit data... | |
| cygwin.asm | Loading commit data... | |
| cygwin.h | Loading commit data... | |
| cygwin1.c | Loading commit data... | |
| cygwin2.c | Loading commit data... | |
| darwin.h | Loading commit data... | |
| djgpp.h | Loading commit data... | |
| emmintrin.h | Loading commit data... | |
| freebsd.h | Loading commit data... | |
| freebsd64.h | Loading commit data... | |
| gas.h | Loading commit data... | |
| gmm_malloc.h | Loading commit data... | |
| gmon-sol2.c | Loading commit data... | |
| gnu.h | Loading commit data... | |
| gstabs.h | Loading commit data... | |
| gthr-win32.c | Loading commit data... | |
| host-mingw32.c | Loading commit data... | |
| i386-aout.h | Loading commit data... | |
| i386-coff.h | Loading commit data... | |
| i386-interix.h | Loading commit data... | |
| i386-interix3.h | Loading commit data... | |
| i386-modes.def | Loading commit data... | |
| i386-protos.h | Loading commit data... | |
| i386.c | Loading commit data... | |
| i386.h | Loading commit data... | |
| i386.md | Loading commit data... | |
| i386elf.h | Loading commit data... | |
| k6.md | Loading commit data... | |
| kaos-i386.h | Loading commit data... | |
| kfreebsd-gnu.h | Loading commit data... | |
| knetbsd-gnu.h | Loading commit data... | |
| libgcc-x86_64-glibc.ver | Loading commit data... | |
| linux.h | Loading commit data... | |
| linux64.h | Loading commit data... | |
| lynx.h | Loading commit data... | |
| mach.h | Loading commit data... | |
| mingw32.h | Loading commit data... | |
| mm3dnow.h | Loading commit data... | |
| mmintrin.h | Loading commit data... | |
| netbsd-elf.h | Loading commit data... | |
| netbsd.h | Loading commit data... | |
| netbsd64.h | Loading commit data... | |
| nto.h | Loading commit data... | |
| openbsd.h | Loading commit data... | |
| pentium.md | Loading commit data... | |
| pmm_malloc.h | Loading commit data... | |
| pmmintrin.h | Loading commit data... | |
| ppro.md | Loading commit data... | |
| predicates.md | Loading commit data... | |
| ptx4-i.h | Loading commit data... | |
| rtemself.h | Loading commit data... | |
| sco5.h | Loading commit data... | |
| scodbx.h | Loading commit data... | |
| sol2-c1.asm | Loading commit data... | |
| sol2-ci.asm | Loading commit data... | |
| sol2-cn.asm | Loading commit data... | |
| sol2-gc1.asm | Loading commit data... | |
| sol2.h | Loading commit data... | |
| sysv3.h | Loading commit data... | |
| sysv4-cpp.h | Loading commit data... | |
| sysv4.h | Loading commit data... | |
| sysv5.h | Loading commit data... | |
| t-beos | Loading commit data... | |
| t-crtpic | Loading commit data... | |
| t-crtstuff | Loading commit data... | |
| t-cygming | Loading commit data... | |
| t-cygwin | Loading commit data... | |
| t-djgpp | Loading commit data... | |
| t-gmm_malloc | Loading commit data... | |
| t-i386elf | Loading commit data... | |
| t-interix | Loading commit data... | |
| t-linux64 | Loading commit data... | |
| t-mingw32 | Loading commit data... | |
| t-nto | Loading commit data... | |
| t-openbsd | Loading commit data... | |
| t-pmm_malloc | Loading commit data... | |
| t-rtems-i386 | Loading commit data... | |
| t-sco5 | Loading commit data... | |
| t-sol2 | Loading commit data... | |
| t-svr3dbx | Loading commit data... | |
| t-uwin | Loading commit data... | |
| t-vxworks | Loading commit data... | |
| unix.h | Loading commit data... | |
| uwin.asm | Loading commit data... | |
| uwin.h | Loading commit data... | |
| vxworks.h | Loading commit data... | |
| winnt.c | Loading commit data... | |
| x-mingw32 | Loading commit data... | |
| x86-64.h | Loading commit data... | |
| xm-cygwin.h | Loading commit data... | |
| xm-dgux.h | Loading commit data... | |
| xm-djgpp.h | Loading commit data... | |
| xm-mingw32.h | Loading commit data... | |
| xm-sun.h | Loading commit data... | |
| xm-sysv3.h | Loading commit data... | |
| xmmintrin.h | Loading commit data... |