This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [trans-mem] PR46941: Mark new/delete operators as transaction_pure
- From: Patrick Marlier <patrick dot marlier at unine dot ch>
- To: Richard Henderson <rth at redhat dot com>
- Cc: Aldy Hernandez <aldyh at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 18 Jan 2011 15:44:56 +0100
- Subject: Re: [trans-mem] PR46941: Mark new/delete operators as transaction_pure
- References: <4D2DF519.1020302@redhat.com> <4D2DFA0E.7030805@redhat.com>
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;
}