From patchwork Wed Nov 3 16:16:15 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 70036 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 932DAB6F11 for ; Thu, 4 Nov 2010 03:16:30 +1100 (EST) Received: (qmail 22525 invoked by alias); 3 Nov 2010 16:16:28 -0000 Received: (qmail 22500 invoked by uid 22791); 3 Nov 2010 16:16:25 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 03 Nov 2010 16:16:21 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oA3GGJWE015166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 3 Nov 2010 12:16:20 -0400 Received: from redhat.com (vpn-11-98.rdu.redhat.com [10.11.11.98]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oA3GGGBF001645 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 3 Nov 2010 12:16:18 -0400 Date: Wed, 3 Nov 2010 12:16:15 -0400 From: Aldy Hernandez To: rth@redhat.com, gcc-patches@gcc.gnu.org Subject: [trans-mem] PR/45985: set frequency for irrevocable calls Message-ID: <20101103161612.GA14423@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-08-17) 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 A while ago, a merge into the trans-mem branch brought some changes to verify_cgraph_node() to verify that the callee and callers on an edge had the same frequency. As part of that merge, I found that the edge created for TM_GETTMCLONE calls did not have the frequency set (see ipa_tm_insert_gettmclone_call). This PR found another call to cgraph_create_edge() without frequency information, which is causing the verify_cgraph_node() to fail. I should have checked all calls to cgraph_create_edge() at merge time. Luckily, this is the only remaining call. OK for branch? Back on the saddle. Aldy p.s. The curious reader may note that rth has been PR/45985 * trans-mem.c (ipa_tm_insert_irr_call): Pass frequency to cgraph_create_edge. Index: testsuite/gcc.dg/tm/pr45985.c =================================================================== --- testsuite/gcc.dg/tm/pr45985.c (revision 0) +++ testsuite/gcc.dg/tm/pr45985.c (revision 0) @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm" } */ + +__attribute__((transaction_unsafe)) +void illegal(); + +static int a = 0; +void func() +{ + __transaction [[relaxed]] { + if( a == 0) + illegal(); + } +} Index: trans-mem.c =================================================================== --- trans-mem.c (revision 166180) +++ trans-mem.c (working copy) @@ -4021,7 +4021,10 @@ ipa_tm_insert_irr_call (struct cgraph_no cgraph_create_edge (node, cgraph_node (built_in_decls[BUILT_IN_TM_IRREVOCABLE]), - g, 0, 0, bb->loop_depth); + g, 0, + compute_call_stmt_bb_frequency (node->decl, + gimple_bb (g)), + bb->loop_depth); } /* Construct a call to TM_GETTMCLONE and insert it before GSI. */