http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46646

           Summary: [trans-mem] __cxa_rethrow and __builtin_eh_pointer are
                    unsafe
           Product: gcc
           Version: trans-mem
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassig...@gcc.gnu.org
        ReportedBy: patrick.marl...@gmail.com


I try to 'transactify' STL and I fall into this:

/gcc/transactional-memory/libstdc++-v3/include/bits/stl_list.h: At global
scope:
/gcc/transactional-memory/libstdc++-v3/include/bits/stl_list.h:472:6: error:
unsafe function call ‘void
 __cxa_rethrow()’ within ‘transaction_safe’ function
/gcc/transactional-memory/libstdc++-v3/include/bits/stl_list.h:469:2: error:
unsafe function call ‘void
* __builtin_eh_pointer(int)’ within ‘transaction_safe’ function

Temporary I set these functions as transaction_safe but I think __cxa_rethrow
needs a replacement to _ITM_cxa_rethrow.

Patrick Marlier.

Index: except.c
===================================================================
--- except.c    (revision 167126)
+++ except.c    (working copy)
@@ -149,8 +149,12 @@
 tree
 build_exc_ptr (void)
 {
-  return build_call_n (built_in_decls [BUILT_IN_EH_POINTER],
-                      1, integer_zero_node);
+  tree tmp = built_in_decls [BUILT_IN_EH_POINTER];
+
+  if (flag_tm)
+    apply_tm_attr (tmp, get_identifier ("transaction_pure"));
+
+  return build_call_n (tmp, 1, integer_zero_node); 
 }

 /* Declare a function NAME, returning RETURN_TYPE, taking a single
@@ -887,6 +891,9 @@
          /* Declare void __cxa_rethrow (void).  */
          fn = push_throw_library_fn
            (fn, build_function_type (void_type_node, void_list_node));
+          /* TODO Add replacement _ITM_cxa_rethrow */
+          if (flag_tm)
+            apply_tm_attr (fn, get_identifier ("transaction_pure"));
        }

       /* ??? Indicate that this function call allows exceptions of the type

Reply via email to