On 01/09/2012 04:19 PM, Patrick Marlier wrote:
On 01/09/2012 04:04 PM, Torvald Riegel wrote:
On Mon, 2012-01-09 at 15:55 -0500, Patrick Marlier wrote:
On my side, I was able to fix the problem with genome but the patch is
not clean at all and I need to find exactly where and why the problem
was fixed.

What do you mean? Do you still see issues with Genome, even with the
returns-twice patch? If so, just on i686 or x86_64 too? With libitm?
Sorry for confusion. Of course, I disabled your returns-twice patch. I
patched at different places and I hope to figure out where is the
problem and that it is not a side effect...
I am currently testing on x86_64 with libitm.

Patrick.


Attached the patch which makes genome works on my side on x86_64.
Torvald: could you tell me if it fixes the problem for you?

I did a regression test and no new failure (I should bootstrap and regtest again, I will do it once I have a feedback on this).

Thanks.
--
Patrick Marlier.
Index: trans-mem.c
===================================================================
--- trans-mem.c	(revision 183073)
+++ trans-mem.c	(working copy)
@@ -2517,6 +2517,7 @@ make_tm_edge (gimple stmt, basic_block bb, struct
     {
       n = ggc_alloc_tm_restart_node ();
       *n = dummy;
+      *slot = n;
     }
   else
     {
Index: cfgexpand.c
===================================================================
--- cfgexpand.c	(revision 183073)
+++ cfgexpand.c	(working copy)
@@ -1978,11 +1978,16 @@ mark_transaction_restart_calls (gimple stmt)
       tree list = n->label_or_list;
       rtx insn;
 
-      for (insn = next_real_insn (get_last_insn ());
-	   !CALL_P (insn);
+      /* ??? mark only the first call, is it right? */
+      for (insn = get_last_insn ();
+	   insn && !CALL_P (insn);
 	   insn = next_real_insn (insn))
 	continue;
 
+      /* ??? insn can be NULL, why? -> some reg_note are missing. */
+      if (!insn || find_reg_note(insn, REG_TM, NULL_RTX))
+	return;
+
       if (TREE_CODE (list) == LABEL_DECL)
 	add_reg_note (insn, REG_TM, label_rtx (list));
       else
@@ -4598,6 +4603,7 @@ gimple_expand_cfg (void)
 	     find_many_sub_basic_blocks will rediscover them.
 	     In the future we should get this fixed properly.  */
 	  if ((e->flags & EDGE_ABNORMAL)
+	      && !(e->flags & EDGE_ABNORMAL_CALL)
 	      && !(e->flags & EDGE_SIBCALL))
 	    remove_edge (e);
 	  else
Index: gtm-builtins.def
===================================================================
--- gtm-builtins.def	(revision 183073)
+++ gtm-builtins.def	(working copy)
@@ -1,5 +1,5 @@
 DEF_TM_BUILTIN (BUILT_IN_TM_START, "_ITM_beginTransaction",
-		BT_FN_UINT_UINT, ATTR_TM_NOTHROW_RT_LIST)
+		BT_FN_UINT_UINT, ATTR_TM_NOTHROW_LIST)
 
 DEF_TM_BUILTIN (BUILT_IN_TM_COMMIT, "_ITM_commitTransaction",
 		BT_FN_VOID, ATTR_TM_NOTHROW_LIST)

Reply via email to