From patchwork Tue Dec 6 16:42:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Marlier X-Patchwork-Id: 129737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 0D21D1007D5 for ; Wed, 7 Dec 2011 03:43:19 +1100 (EST) Received: (qmail 4114 invoked by alias); 6 Dec 2011 16:43:14 -0000 Received: (qmail 4076 invoked by uid 22791); 6 Dec 2011 16:43:11 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vx0-f175.google.com (HELO mail-vx0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Dec 2011 16:42:57 +0000 Received: by vcbfo13 with SMTP id fo13so5434597vcb.20 for ; Tue, 06 Dec 2011 08:42:56 -0800 (PST) Received: by 10.220.225.137 with SMTP id is9mr1714856vcb.259.1323189776467; Tue, 06 Dec 2011 08:42:56 -0800 (PST) Received: from d01.cs.rochester.edu (d01.cs.rochester.edu. [128.151.67.209]) by mx.google.com with ESMTPS id w5sm20684199vdh.17.2011.12.06.08.42.55 (version=SSLv3 cipher=OTHER); Tue, 06 Dec 2011 08:42:55 -0800 (PST) Message-ID: <4EDE460E.3000100@gmail.com> Date: Tue, 06 Dec 2011 11:42:54 -0500 From: Patrick Marlier User-Agent: Mozilla/5.0 (X11; Linux i686; rv:8.0) Gecko/20111115 Thunderbird/8.0 MIME-Version: 1.0 To: Richard Henderson CC: GCC Patches , Jan Hubicka , Aldy Hernandez , Torvald Riegel Subject: [patch,trans-mem] do not remove cgraph_edge after substitution X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * trans-mem.c (ipa_tm_transform_calls_redirect): Do not remove edge. testsuite/ 2011-12-06 Patrick Marlier * g++.dg/tm/cgraph_edge.C: New test. 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 inline void advance(_InputIterator& __i, _Distance __n) + { + if (__n > 0) + while (__n--) + --__i; + else + --__i; + } + +void _Rb_tree_increment (); + +template struct _Rb_tree_iterator + { + typedef _Rb_tree_iterator<_Tp> iterator; + + iterator& operator--() + { + _Rb_tree_increment(); + } + }; + +void update () + { + _Rb_tree_iterator::iterator it; + __transaction_relaxed + { + advance (it, 0); + } + } +