From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31409 invoked by alias); 22 May 2012 15:59:10 -0000 Received: (qmail 31392 invoked by uid 22791); 22 May 2012 15:59:06 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 22 May 2012 15:58:53 +0000 From: "patrick.marlier at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug ada/53008] abort in _ITM_getTMCloneSafe Date: Tue, 22 May 2012 16:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ada X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: patrick.marlier at gmail dot com X-Bugzilla-Status: WAITING X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-05/txt/msg02211.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53008 --- Comment #8 from Patrick Marlier 2012-05-22 15:58:53 UTC --- Aldy, Actually the problem is different that my first thought and it is a real bug. The problem is well described into the 'testcase for gcc testsuite'. In the testcase, you have a static function foo which is transaction_safe so a clone is created. This function foo is assigned to a transaction_safe function pointer and this function pointer is used in a transaction. However this tm-clone foo is never referenced so it is removed by ipa.c:cgraph_remove_unreachable_nodes(). One way to fix the problem is force the output of the clone as following: Index: trans-mem.c =================================================================== --- trans-mem.c (revision 187371) +++ trans-mem.c (working copy) @@ -4330,7 +4330,8 @@ ipa_tm_create_version_alias (struct cgraph_node *n record_tm_clone_pair (old_decl, new_decl); - if (info->old_node->symbol.force_output) + if (info->old_node->symbol.force_output + || ipa_ref_list_first_referring (&info->old_node->symbol.ref_list)) ipa_tm_mark_force_output_node (new_node); return false; } @@ -4383,7 +4384,8 @@ ipa_tm_create_version (struct cgraph_node *old_nod record_tm_clone_pair (old_decl, new_decl); cgraph_call_function_insertion_hooks (new_node); - if (old_node->symbol.force_output) + if (old_node->symbol.force_output + || ipa_ref_list_first_referring (&old_node->symbol.ref_list)) ipa_tm_mark_force_output_node (new_node); /* Do the same thing, but for any aliases of the original node. */ However, I am not sure it is really the way to go. Probably we should add the references from the orginal function to the tm-clone? Thanks, Patrick