From patchwork Tue Dec 14 15:30:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 75500 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 389B4B6F11 for ; Wed, 15 Dec 2010 02:30:44 +1100 (EST) Received: (qmail 8592 invoked by alias); 14 Dec 2010 15:30:42 -0000 Received: (qmail 8580 invoked by uid 22791); 14 Dec 2010 15:30:39 -0000 X-SWARE-Spam-Status: No, hits=-6.3 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; Tue, 14 Dec 2010 15:30:33 +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.13.8/8.13.8) with ESMTP id oBEFUW06015587 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 14 Dec 2010 10:30:32 -0500 Received: from ganesh.quesejoda.com (vpn-8-103.rdu.redhat.com [10.11.8.103]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBEFUVEN007649; Tue, 14 Dec 2010 10:30:31 -0500 Message-ID: <4D078D98.9020801@redhat.com> Date: Tue, 14 Dec 2010 16:30:32 +0100 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.12) Gecko/20101103 Fedora/1.0-0.33.b2pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.6 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org, Richard Henderson Subject: [trans-mem] PR46923 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 requires_barrier should really handle PARM_DECL and RESULT_DECLs, because they can escape the function just like any other variable. The testcase in the PR isn't really valid, because volatiles aren't allowed inside transactions. It was just there to force a small reproducible testcase. Next I will work on warning if we ever try to use volatiles inside transactions. Over-the-shoulder approval, committing, and closing the PR. Aldy PR/46923 * trans-mem.c (requires_barrier): Handle PARM_DECL and RESULT_DECL. Index: trans-mem.c =================================================================== --- trans-mem.c (revision 167796) +++ trans-mem.c (working copy) @@ -1432,6 +1432,8 @@ requires_barrier (basic_block entry_bloc gcc_assert (TREE_CODE (x) == VAR_DECL); /* FALLTHRU */ + case PARM_DECL: + case RESULT_DECL: case VAR_DECL: if (is_global_var (x)) return !TREE_READONLY (x);