From patchwork Thu Feb 24 19:01:43 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 84447 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 C26F6B7105 for ; Fri, 25 Feb 2011 06:01:53 +1100 (EST) Received: (qmail 23134 invoked by alias); 24 Feb 2011 19:01:51 -0000 Received: (qmail 23126 invoked by uid 22791); 24 Feb 2011 19:01:50 -0000 X-SWARE-Spam-Status: No, hits=-6.4 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; Thu, 24 Feb 2011 19:01:46 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p1OJ1iTD001481 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 24 Feb 2011 14:01:44 -0500 Received: from houston.quesejoda.com (vpn-225-111.phx2.redhat.com [10.3.225.111]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1OJ1h19004772; Thu, 24 Feb 2011 14:01:44 -0500 Message-ID: <4D66AB17.9040807@redhat.com> Date: Thu, 24 Feb 2011 13:01:43 -0600 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7 MIME-Version: 1.0 To: Richard Henderson CC: Patrick MARLIER , gcc-patches Subject: Re: [trans-mem] PR47606: Add a tm-safe marker for GIMPLE_ASM's References: <4D658567.2030401@redhat.com> <4D668016.40807@redhat.com> In-Reply-To: <4D668016.40807@redhat.com> 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 > Which then immediately fails for one layer of indirection: Well, this we can fix with a small change to the inliner, by propagating the ASM_TM_SAFE bit through the inlined copies. See patch below. I'm worried the tm_waiver approach will require changes to TM sources. But I'll gladly let you play around with it. Thanks. Index: tree-inline.c =================================================================== --- tree-inline.c (revision 170359) +++ tree-inline.c (working copy) @@ -1476,6 +1476,7 @@ copy_bb (copy_body_data *id, basic_block basic_block copy_basic_block; tree decl; gcov_type freq; + bool dst_fn_is_tm_pure = is_tm_pure (id->dst_fn); /* create_basic_block() will append every new block to basic_block_info automatically. */ @@ -1504,6 +1505,9 @@ copy_bb (copy_body_data *id, basic_block if (gimple_nop_p (stmt)) continue; + if (dst_fn_is_tm_pure && gimple_code (stmt) == GIMPLE_ASM) + gimple_asm_set_tm_safe (stmt, true); + gimple_duplicate_stmt_histograms (cfun, stmt, id->src_cfun, orig_stmt); seq_gsi = copy_gsi;