This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [trans-mem] PR46941: Mark new/delete operators as transaction_pure


I am not agree. Functions should be marked as transaction_safe not transaction_pure because libitm is managing those new/delete safe allocations.

Attached one patch to fix this.

It causes a regression on
* testsuite/g++.dg/tm/pr45940-3.C
* testsuite/g++.dg/tm/pr45940-4.C

but it seems another problem, reported here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47340

Removing the transaction_safe declaration on these testcases make them pass.

Changelog

	* cp/decl.c (push_cp_library_fn): Mark function as
	transaction_safe.

On 01/12/2011 07:59 PM, Richard Henderson wrote:
On 01/12/2011 10:38 AM, Aldy Hernandez wrote:
	* cp/decl.c (push_cp_library_fn): Mark function as
	transaction_pure.

Ok.



r~


Index: gcc/testsuite/g++.dg/tm/pr46941.C
===================================================================
--- gcc/testsuite/g++.dg/tm/pr46941.C	(revision 168943)
+++ gcc/testsuite/g++.dg/tm/pr46941.C	(working copy)
@@ -29,3 +29,7 @@
 { 
   delete [] o;
 }
+/* { dg-final { scan-assembler "_ZGTtnwm" } } */
+/* { dg-final { scan-assembler "_ZGTtnam" } } */
+/* { dg-final { scan-assembler "_ZGTtdlPv" } } */
+/* { dg-final { scan-assembler "_ZGTtdaPv" } } */
Index: gcc/cp/decl.c
===================================================================
--- gcc/cp/decl.c	(revision 168943)
+++ gcc/cp/decl.c	(working copy)
@@ -3776,7 +3776,7 @@
 				 type);
   pushdecl (fn);
   if (flag_tm)
-    apply_tm_attr (fn, get_identifier ("transaction_pure"));
+    apply_tm_attr (fn, get_identifier ("transaction_safe"));
   return fn;
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]