Index: include/ChangeLog.tm =================================================================== --- include/ChangeLog.tm (.../trunk) (revision 0) +++ include/ChangeLog.tm (.../branches/transactional-memory) (revision 180773) @@ -0,0 +1,9 @@ +2011-03-10 Richard Henderson + + * demangle.h (enum gnu_v3_ctor_kinds): Add gnu_v3_object_ctor_group. + (enum gnu_v3_dtor_kinds): Add gnu_v3_object_dtor_group. + +2008-11-05 Richard Henderson + + * demangle.h (DEMANGLE_COMPONENT_TRANSACTION_CLONE): New. + (DEMANGLE_COMPONENT_NONTRANSACTION_CLONE): New. Index: libiberty/ChangeLog.tm =================================================================== --- libiberty/ChangeLog.tm (.../trunk) (revision 0) +++ libiberty/ChangeLog.tm (.../branches/transactional-memory) (revision 180773) @@ -0,0 +1,15 @@ +2011-03-10 Richard Henderson + + PR 47952 + * cp-demangle.c (cplus_demangle_fill_ctor): Accept + gnu_v3_object_ctor_group. + (cplus_demangle_fill_dtor): Accept gnu_v3_object_dtor_group. + (d_ctor_dtor_name): Recognize gnu_v3_object_ctor_group + and gnu_v3_object_dtor_group. + +2008-11-05 Richard Henderson + + * cp-demangle.c (d_dump): Handle DEMANGLE_COMPONENT_TRANSACTION_CLONE + and DEMANGLE_COMPONENT_NONTRANSACTION_CLONE. + (d_make_comp, d_print_comp): Likewise. + (d_special_name): Generate them. Index: include/demangle.h =================================================================== --- include/demangle.h (.../trunk) (revision 180744) +++ include/demangle.h (.../branches/transactional-memory) (revision 180773) @@ -172,7 +172,8 @@ ada_demangle (const char *mangled, int o enum gnu_v3_ctor_kinds { gnu_v3_complete_object_ctor = 1, gnu_v3_base_object_ctor, - gnu_v3_complete_object_allocating_ctor + gnu_v3_complete_object_allocating_ctor, + gnu_v3_object_ctor_group }; /* Return non-zero iff NAME is the mangled form of a constructor name @@ -186,7 +187,8 @@ extern enum gnu_v3_ctor_kinds enum gnu_v3_dtor_kinds { gnu_v3_deleting_dtor = 1, gnu_v3_complete_object_dtor, - gnu_v3_base_object_dtor + gnu_v3_base_object_dtor, + gnu_v3_object_dtor_group }; /* Return non-zero iff NAME is the mangled form of a destructor name @@ -401,6 +403,13 @@ enum demangle_component_type DEMANGLE_COMPONENT_DEFAULT_ARG, /* An unnamed type. */ DEMANGLE_COMPONENT_UNNAMED_TYPE, + /* A transactional clone. This has one subtree, the encoding for + which it is providing alternative linkage. */ + DEMANGLE_COMPONENT_TRANSACTION_CLONE, + /* A non-transactional clone entry point. In the i386/x86_64 abi, + the unmangled symbol of a tm_callable becomes a thunk and the + non-transactional function version is mangled thus. */ + DEMANGLE_COMPONENT_NONTRANSACTION_CLONE, /* A pack expansion. */ DEMANGLE_COMPONENT_PACK_EXPANSION, /* A cloned function. */ Index: libiberty/cp-demangle.c =================================================================== --- libiberty/cp-demangle.c (.../trunk) (revision 180744) +++ libiberty/cp-demangle.c (.../branches/transactional-memory) (revision 180773) @@ -585,6 +585,12 @@ d_dump (struct demangle_component *dc, i case DEMANGLE_COMPONENT_HIDDEN_ALIAS: printf ("hidden alias\n"); break; + case DEMANGLE_COMPONENT_TRANSACTION_CLONE: + printf ("transaction clone\n"); + break; + case DEMANGLE_COMPONENT_NONTRANSACTION_CLONE: + printf ("non-transaction clone\n"); + break; case DEMANGLE_COMPONENT_RESTRICT: printf ("restrict\n"); break; @@ -732,7 +738,7 @@ cplus_demangle_fill_ctor (struct demangl if (p == NULL || name == NULL || (int) kind < gnu_v3_complete_object_ctor - || (int) kind > gnu_v3_complete_object_allocating_ctor) + || (int) kind > gnu_v3_object_ctor_group) return 0; p->type = DEMANGLE_COMPONENT_CTOR; p->u.s_ctor.kind = kind; @@ -751,7 +757,7 @@ cplus_demangle_fill_dtor (struct demangl if (p == NULL || name == NULL || (int) kind < gnu_v3_deleting_dtor - || (int) kind > gnu_v3_base_object_dtor) + || (int) kind > gnu_v3_object_dtor_group) return 0; p->type = DEMANGLE_COMPONENT_DTOR; p->u.s_dtor.kind = kind; @@ -823,6 +829,8 @@ d_make_comp (struct d_info *di, enum dem case DEMANGLE_COMPONENT_GUARD: case DEMANGLE_COMPONENT_REFTEMP: case DEMANGLE_COMPONENT_HIDDEN_ALIAS: + case DEMANGLE_COMPONENT_TRANSACTION_CLONE: + case DEMANGLE_COMPONENT_NONTRANSACTION_CLONE: case DEMANGLE_COMPONENT_POINTER: case DEMANGLE_COMPONENT_REFERENCE: case DEMANGLE_COMPONENT_RVALUE_REFERENCE: @@ -1762,6 +1770,8 @@ d_java_resource (struct d_info *di) ::= GR ::= GA ::= Gr + ::= GTt + ::= GTn */ static struct demangle_component * @@ -1853,6 +1863,23 @@ d_special_name (struct d_info *di) return d_make_comp (di, DEMANGLE_COMPONENT_HIDDEN_ALIAS, d_encoding (di, 0), NULL); + case 'T': + switch (d_next_char (di)) + { + case 'n': + return d_make_comp (di, DEMANGLE_COMPONENT_NONTRANSACTION_CLONE, + d_encoding (di, 0), NULL); + default: + /* ??? The proposal is that other letters (such as 'h') stand + for different variants of transaction cloning, such as + compiling directly for hardware transaction support. But + they still should all be transactional clones of some sort + so go ahead and call them that. */ + case 't': + return d_make_comp (di, DEMANGLE_COMPONENT_TRANSACTION_CLONE, + d_encoding (di, 0), NULL); + } + case 'r': return d_java_resource (di); @@ -1936,6 +1963,9 @@ d_ctor_dtor_name (struct d_info *di) case '3': kind = gnu_v3_complete_object_allocating_ctor; break; + case '5': + kind = gnu_v3_object_ctor_group; + break; default: return NULL; } @@ -1958,6 +1988,9 @@ d_ctor_dtor_name (struct d_info *di) case '2': kind = gnu_v3_base_object_dtor; break; + case '5': + kind = gnu_v3_object_dtor_group; + break; default: return NULL; } @@ -3930,6 +3963,16 @@ d_print_comp (struct d_print_info *dpi, d_print_comp (dpi, options, d_left (dc)); return; + case DEMANGLE_COMPONENT_TRANSACTION_CLONE: + d_append_string (dpi, "transaction clone for "); + d_print_comp (dpi, options, d_left (dc)); + return; + + case DEMANGLE_COMPONENT_NONTRANSACTION_CLONE: + d_append_string (dpi, "non-transaction clone for "); + d_print_comp (dpi, options, d_left (dc)); + return; + case DEMANGLE_COMPONENT_SUB_STD: d_append_buffer (dpi, dc->u.s_string.string, dc->u.s_string.len); return; Index: contrib/gcc_update =================================================================== --- contrib/gcc_update (.../trunk) (revision 180744) +++ contrib/gcc_update (.../branches/transactional-memory) (revision 180773) @@ -136,6 +136,11 @@ libgomp/Makefile.in: libgomp/Makefile.am libgomp/testsuite/Makefile.in: libgomp/Makefile.am libgomp/aclocal.m4 libgomp/configure: libgomp/configure.ac libgomp/aclocal.m4 libgomp/config.h.in: libgomp/configure.ac libgomp/aclocal.m4 +libitm/aclocal.m4: libitm/configure.ac libitm/acinclude.m4 +libitm/Makefile.in: libitm/Makefile.am libitm/aclocal.m4 +libitm/testsuite/Makefile.in: libitm/testsuite/Makefile.am libitm/aclocal.m4 +libitm/configure: libitm/configure.ac libitm/aclocal.m4 +libitm/config.h.in: libitm/configure.ac libitm/aclocal.m4 # Top level Makefile.in: Makefile.tpl Makefile.def configure: configure.ac config/acx.m4 Index: config/mmap.m4 =================================================================== --- config/mmap.m4 (.../trunk) (revision 0) +++ config/mmap.m4 (.../branches/transactional-memory) (revision 180773) @@ -0,0 +1,97 @@ +dnl ---------------------------------------------------------------------- +dnl This whole bit snagged from gcc + +dnl +dnl mmap(2) blacklisting. Some platforms provide the mmap library routine +dnl but don't support all of the features we need from it. +dnl +AC_DEFUN([GCC_AC_FUNC_MMAP_BLACKLIST], +[ +AC_CHECK_HEADER([sys/mman.h], + [gcc_header_sys_mman_h=yes], [gcc_header_sys_mman_h=no]) +AC_CHECK_FUNC([mmap], [gcc_func_mmap=yes], [gcc_func_mmap=no]) +if test "$gcc_header_sys_mman_h" != yes \ + || test "$gcc_func_mmap" != yes; then + gcc_cv_func_mmap_file=no + gcc_cv_func_mmap_dev_zero=no + gcc_cv_func_mmap_anon=no +else + AC_CACHE_CHECK([whether read-only mmap of a plain file works], + gcc_cv_func_mmap_file, + [# Add a system to this blacklist if + # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a + # memory area containing the same data that you'd get if you applied + # read() to the same fd. The only system known to have a problem here + # is VMS, where text files have record structure. + case "$host_os" in + vms* | ultrix*) + gcc_cv_func_mmap_file=no ;; + *) + gcc_cv_func_mmap_file=yes;; + esac]) + AC_CACHE_CHECK([whether mmap from /dev/zero works], + gcc_cv_func_mmap_dev_zero, + [# Add a system to this blacklist if it has mmap() but /dev/zero + # does not exist, or if mmapping /dev/zero does not give anonymous + # zeroed pages with both the following properties: + # 1. If you map N consecutive pages in with one call, and then + # unmap any subset of those pages, the pages that were not + # explicitly unmapped remain accessible. + # 2. If you map two adjacent blocks of memory and then unmap them + # both at once, they must both go away. + # Systems known to be in this category are Windows (all variants), + # VMS, and Darwin. + case "$host_os" in + vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00) + gcc_cv_func_mmap_dev_zero=no ;; + *) + gcc_cv_func_mmap_dev_zero=yes;; + esac]) + + # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for. + AC_CACHE_CHECK([for MAP_ANON(YMOUS)], gcc_cv_decl_map_anon, + [AC_COMPILE_IFELSE([AC_LANG_PROGRAM( +[#include +#include +#include + +#ifndef MAP_ANONYMOUS +#define MAP_ANONYMOUS MAP_ANON +#endif +], +[int n = MAP_ANONYMOUS;])], + gcc_cv_decl_map_anon=yes, + gcc_cv_decl_map_anon=no)]) + + if test $gcc_cv_decl_map_anon = no; then + gcc_cv_func_mmap_anon=no + else + AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works], + gcc_cv_func_mmap_anon, + [# Add a system to this blacklist if it has mmap() and MAP_ANON or + # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) + # doesn't give anonymous zeroed pages with the same properties listed + # above for use of /dev/zero. + # Systems known to be in this category are Windows, VMS, and SCO Unix. + case "$host_os" in + vms* | cygwin* | pe | mingw* | sco* | udk* ) + gcc_cv_func_mmap_anon=no ;; + *) + gcc_cv_func_mmap_anon=yes;; + esac]) + fi +fi + +if test $gcc_cv_func_mmap_file = yes; then + AC_DEFINE(HAVE_MMAP_FILE, 1, + [Define if read-only mmap of a plain file works.]) +fi +if test $gcc_cv_func_mmap_dev_zero = yes; then + AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1, + [Define if mmap of /dev/zero works.]) +fi +if test $gcc_cv_func_mmap_anon = yes; then + AC_DEFINE(HAVE_MMAP_ANON, 1, + [Define if mmap with MAP_ANON(YMOUS) works.]) +fi +])