===================================================================
@@ -0,0 +1,22 @@
+/* { dg-do compile } */
+/* { dg-options "-fgnu-tm -fdump-tree-optimized" } */
+
+struct C {
+ long l;
+ C():l(0) {}
+};
+
+int main()
+{
+ C* alloc;
+ __transaction_atomic {
+ alloc = new C;
+ }
+ alloc->l = 2;
+
+ return 0;
+}
+
+/* { dg-final { scan-assembler-not "_ITM_getTMCloneOrIrrevocable" } } */
+/* { dg-final { scan-tree-dump-times ";; Function C::C" 1 "optimized" } } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */
===================================================================
@@ -3552,6 +3552,9 @@ ipa_tm_scan_calls_block (cgraph_node_que
node = cgraph_get_node (fndecl);
gcc_assert (node != NULL);
+ if (node->alias)
+ node = cgraph_get_node (node->thunk.alias);
+
d = get_cg_data (node);
pcallers = (for_clone ? &d->tm_callers_clone
@@ -3839,13 +3842,20 @@ ipa_tm_decrement_clone_counts (basic_blo
{
struct tm_ipa_cg_data *d;
unsigned *pcallers;
+ struct cgraph_node *node;
if (is_tm_ending_fndecl (fndecl))
continue;
if (find_tm_replacement_function (fndecl))
continue;
- d = get_cg_data (cgraph_get_node (fndecl));
+ node = cgraph_get_node (fndecl);
+
+ if (node->alias)
+ node = cgraph_get_node (node->thunk.alias);
+
+ d = get_cg_data (node);
+
pcallers = (for_clone ? &d->tm_callers_clone
: &d->tm_callers_normal);