From patchwork Fri Sep 21 18:16:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 185871 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 C9CBA2C0081 for ; Sat, 22 Sep 2012 04:16:46 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1348856207; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=2ANYu/SpQHo13pntvkCSZvVMlDs=; b=oyX0c1RRZq2fsjE /xFrIFoFiwhGzoSD/FgyUKVZXv/HYuggz9PLMRJ2a4dS4BLG9h1fuuf8o/3y2LlU J9dVa8IxqV/1FkzPuklBPFn2uCKuOw2FF+pD/rgAnewPa8PKhiSSVr5G3zKKXlPb RlYZKkJL30rFBltKyjcEaWvWH/KQ= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject:References:In-Reply-To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=tS5L27QAxgBf5CEkTcHR+WjYc9xcGd1BbH6MQqPFOXKMVeSr+pdvmRhfwWqsEm llYzW5JfJhmm1rOvXJrx5yrbE4eQrya6NRtZbEa3XaJi3EQFUte9Mucw/WDA73zk U7x3dWkHq5njBjl18XJzQJ/kfL0I7U6cI9qj0q7qgrST8=; Received: (qmail 2253 invoked by alias); 21 Sep 2012 18:16:38 -0000 Received: (qmail 2232 invoked by uid 22791); 21 Sep 2012 18:16:36 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_THREADED, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS 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; Fri, 21 Sep 2012 18:16:18 +0000 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q8LIGHsa027088 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Sep 2012 14:16:18 -0400 Received: from houston.quesejoda.com (vpn-10-64.rdu.redhat.com [10.11.10.64]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8LIGHJR010929; Fri, 21 Sep 2012 14:16:17 -0400 Message-ID: <505CAEF0.6090705@redhat.com> Date: Fri, 21 Sep 2012 13:16:16 -0500 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120828 Thunderbird/15.0 MIME-Version: 1.0 To: Richard Guenther CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR52173 References: In-Reply-To: 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 On 09/21/12 08:52, Richard Guenther wrote: > > This bug happens because GIMPLE_TRANSACTION is a statement > without real but with virtual operands. The short-cut in gimple_copy > thus is overly optimistic. Fixed as follows. Thank you so much for fixing this. When you apply the patch, do you mind including the attached tests-- assuming you are ok with them? Or I can commit them after you commit your patch if you prefer. Thanks again. Aldy testsuite/ PR middle-end/52173 * gcc.dg/tm/pr52173-1.c: New. * gcc.dg/tm/pr52173-2.c: New. diff --git a/gcc/testsuite/gcc.dg/tm/pr52173-1.c b/gcc/testsuite/gcc.dg/tm/pr52173-1.c new file mode 100644 index 0000000..9ffa4d6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/pr52173-1.c @@ -0,0 +1,19 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -O3" } */ + +int vec[500]; + +void func() +{ + __transaction_relaxed + { + vec[123] = 456; + } +} + +main() +{ + int i; + for(i = 0; i < 10; ++i) + func(); +} diff --git a/gcc/testsuite/gcc.dg/tm/pr52173-2.c b/gcc/testsuite/gcc.dg/tm/pr52173-2.c new file mode 100644 index 0000000..ca64893 --- /dev/null +++ b/gcc/testsuite/gcc.dg/tm/pr52173-2.c @@ -0,0 +1,12 @@ +/* { dg-do compile } */ +/* { dg-options "-fgnu-tm -O2" } */ + +int a; + +int main() +{ + int i; + for (i = 0; i < 1; ++i) + __transaction_atomic { ++a; } + return 0; +}