backport: re PR middle-end/53008 (abort in _ITM_getTMCloneSafe)

Backport from mainline
        2012-05-25  Aldy Hernandez  <aldyh@redhat.com>
        PR middle-end/53008
        * trans-mem.c (ipa_tm_create_version_alias): Output new_node if
        accessed indirectly.
        (ipa_tm_create_version): Same.

From-SVN: r188030
This commit is contained in:
Aldy Hernandez 2012-05-30 22:13:43 +00:00 committed by Aldy Hernandez
parent dc366fdcab
commit 5068ef7119
3 changed files with 28 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2012-05-30 Aldy Hernandez <aldyh@redhat.com>
Backport from mainline
2012-05-25 Aldy Hernandez <aldyh@redhat.com>
PR middle-end/53008
* trans-mem.c (ipa_tm_create_version_alias): Output new_node if
accessed indirectly.
(ipa_tm_create_version): Same.
2012-05-30 Jason Merrill <jason@redhat.com>
PR c++/53220

View File

@ -0,0 +1,14 @@
/* { dg-do compile } */
/* { dg-options "-fgnu-tm -O" } */
void __attribute__((transaction_safe)) (*fn)(void);
static void __attribute__((transaction_safe))
foo(void)
{
}
void set_fn(void)
{
fn = foo;
}

View File

@ -4319,7 +4319,8 @@ ipa_tm_create_version_alias (struct cgraph_node *node, void *data)
record_tm_clone_pair (old_decl, new_decl);
if (info->old_node->needed)
if (info->old_node->needed
|| ipa_ref_list_first_refering (&info->old_node->ref_list))
ipa_tm_mark_needed_node (new_node);
return false;
}
@ -4372,7 +4373,8 @@ ipa_tm_create_version (struct cgraph_node *old_node)
record_tm_clone_pair (old_decl, new_decl);
cgraph_call_function_insertion_hooks (new_node);
if (old_node->needed)
if (old_node->needed
|| ipa_ref_list_first_refering (&old_node->ref_list))
ipa_tm_mark_needed_node (new_node);
/* Do the same thing, but for any aliases of the original node. */