This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46941] [trans-mem] new/delete operator are unsafe
- From: "aldyh at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 23 Dec 2010 16:19:28 +0000
- Subject: [Bug c++/46941] [trans-mem] new/delete operator are unsafe
- Auto-submitted: auto-generated
- References: <bug-46941-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46941
--- Comment #4 from Aldy Hernandez <aldyh at gcc dot gnu.org> 2010-12-23 16:19:12 UTC ---
Patrick.
You will find out that when hacking on GCC, everything is intrusive in
non-obvious ways :).
What I had in mind was something simple like this, since push_cp_library_fn()
only gets called when creating delete/new operators.
Index: cp/decl.c
===================================================================
--- cp/decl.c (revision 168123)
+++ cp/decl.c (working copy)
@@ -3775,6 +3775,8 @@ push_cp_library_fn (enum tree_code opera
operator_code,
type);
pushdecl (fn);
+ if (flag_tm)
+ apply_tm_attr (fn, get_identifier ("transaction_pure"));
return fn;
}
However, this is exhibiting an unrelated bug with inlining that I am
investigating.
Thanks for all your bugreports! They've made my life easier.