diff mbox

[trans-mem] do not remove cgraph_edge after substitution

Message ID 4EDE460E.3000100@gmail.com
State New
Headers show

Commit Message

Patrick Marlier Dec. 6, 2011, 4:42 p.m. UTC
Hi,

In testcase cgraph_edge.C, inline_edge_summary in 
estimate_function_body_sizes fails because there is no callgraph edge 
representing the stmt.
The edge was removed in ipa_tm_transform_calls_redirect after 
transforming to indirect call.

Honza: I have added you to this email since Richard was not sure about 
edge removal.

Patrick.

gcc/
2011-12-06  Patrick Marlier  <patrick.marlier@gmail.com>

	* trans-mem.c (ipa_tm_transform_calls_redirect): Do not remove
	edge.

testsuite/
2011-12-06  Patrick Marlier  <patrick.marlier@gmail.com>

	* g++.dg/tm/cgraph_edge.C: New test.

Comments

Richard Henderson Dec. 6, 2011, 9:12 p.m. UTC | #1
On 12/06/2011 08:42 AM, Patrick Marlier wrote:
> 2011-12-06  Patrick Marlier  <patrick.marlier@gmail.com>
> 
>     * trans-mem.c (ipa_tm_transform_calls_redirect): Do not remove
>     edge.
> 
> testsuite/
> 2011-12-06  Patrick Marlier  <patrick.marlier@gmail.com>
> 
>     * g++.dg/tm/cgraph_edge.C: New test.

Ok.


r~
diff mbox

Patch

Index: trans-mem.c
===================================================================
--- trans-mem.c	(revision 181892)
+++ trans-mem.c	(working copy)
@@ -4481,7 +4481,6 @@  ipa_tm_transform_calls_redirect (struct cgraph_nod
 	{
 	  *need_ssa_rename_p |=
 	    ipa_tm_insert_gettmclone_call (node, region, gsi, stmt);
-	  cgraph_remove_edge (e);
 	  return;
 	}
 
Index: testsuite/g++.dg/tm/cgraph_edge.C
===================================================================
--- testsuite/g++.dg/tm/cgraph_edge.C	(revision 0)
+++ testsuite/g++.dg/tm/cgraph_edge.C	(revision 0)
@@ -0,0 +1,33 @@ 
+// { dg-do compile }
+// { dg-options "-fgnu-tm -O3" }
+
+template<typename _InputIterator, typename _Distance>  inline void advance(_InputIterator& __i, _Distance __n)
+  {
+    if (__n > 0) 
+      while (__n--)
+        --__i;
+    else  
+      --__i;
+  }
+
+void  _Rb_tree_increment ();
+
+template<typename _Tp> struct _Rb_tree_iterator 
+  {
+    typedef _Rb_tree_iterator<_Tp> iterator;
+
+    iterator& operator--()
+      {
+        _Rb_tree_increment();
+      }
+  };
+
+void update ()
+  {
+    _Rb_tree_iterator<int>::iterator it;
+    __transaction_relaxed
+      {
+        advance (it, 0);
+      }
+  }
+