From patchwork Mon Jan 16 15:58:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aldy Hernandez X-Patchwork-Id: 136292 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 F03DFB6EFE for ; Tue, 17 Jan 2012 02:58:51 +1100 (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=1327334332; 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=ToReEIytXpUWZNpfhzLfmGytKhM=; b=uWbYISQICtZLccG ei0EkRCszSuW2n8u/J9sY59ZQs14amdrfWJLhnGJC9zcU/pfIQGbvcsbvPrze4Jb nPSPheeqjhW3ps2CXlmVr3r5Fle1ohnGopqswfbkS+JxDAAlbxZ0xB0Q9p73eOH/ MNJK7oD+H3ZsXtoWH54rYp1RFSV4= 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=SVJwGQ18JrRFWRN7BSAOb0JpJ4LgI+GRWs7L5zw+LoW4HrG9nmFn9qkoMeqKoP oZTR4y2m0wadneblakhjplK/Rc26ZueC/b6xv1D2e/chBrltkL8kV4KczIBicIzz Wdf1Vtdbg2ZDU1DzsZUl3ctnrsUkuetBcgmWq4A3fJwls=; Received: (qmail 19241 invoked by alias); 16 Jan 2012 15:58:46 -0000 Received: (qmail 19230 invoked by uid 22791); 16 Jan 2012 15:58:44 -0000 X-SWARE-Spam-Status: No, hits=-6.7 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; Mon, 16 Jan 2012 15:58:30 +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.14.4/8.14.4) with ESMTP id q0GFwU69020424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 16 Jan 2012 10:58:30 -0500 Received: from houston.quesejoda.com (vpn-10-128.rdu.redhat.com [10.11.10.128]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0GFwTvP007822; Mon, 16 Jan 2012 10:58:29 -0500 Message-ID: <4F144924.8030007@redhat.com> Date: Mon, 16 Jan 2012 09:58:28 -0600 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: Richard Guenther CC: gcc-patches Subject: Re: PR other/51165: add new adress_escapes predicate References: <4F14342D.8080400@redhat.com> 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 > Not really - you handle both ptr and *ptr in the same predicate and > call both "address escaped". What I suggested was sth like I think I confused myself and you by asking the wrong question in the first place. Actually, what I want is to handle VAR_DECL correctly, and your original suggestion of using may_be_aliased() fits the bill. The other calls to ptr_deref_may_alias_global_p() were fine because we have an SSA_NAME. We're now down to a one-liner :). How about this? All TM memory optimization tests fixed, and no regressions. PR other/51165 * trans-mem.c (requires_barrier): Call may_be_aliased. testsuite/ PR other/51165 * gcc.dg/tm/memopt-3.c: Remove xfail. * gcc.dg/tm/memopt-4.c: Remove xfail. * gcc.dg/tm/memopt-5.c: Remove xfail. * gcc.dg/tm/memopt-7.c: Remove xfail. Index: testsuite/gcc.dg/tm/memopt-3.c =================================================================== --- testsuite/gcc.dg/tm/memopt-3.c (revision 183072) +++ testsuite/gcc.dg/tm/memopt-3.c (working copy) @@ -16,5 +16,5 @@ int f() return lala.x[0]; } -/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_1\\\]" 1 "tmmark" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "logging: lala.x\\\[i_1\\\]" 1 "tmmark" } } */ /* { dg-final { cleanup-tree-dump "tmmark" } } */ Index: testsuite/gcc.dg/tm/memopt-5.c =================================================================== --- testsuite/gcc.dg/tm/memopt-5.c (revision 183072) +++ testsuite/gcc.dg/tm/memopt-5.c (working copy) @@ -19,5 +19,5 @@ int f() return lala.x[i]; } -/* { dg-final { scan-tree-dump-times "ITM_LU\[0-9\] \\\(&lala.x\\\[55\\\]" 1 "tmedge" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "ITM_LU\[0-9\] \\\(&lala.x\\\[55\\\]" 1 "tmedge" } } */ /* { dg-final { cleanup-tree-dump "tmedge" } } */ Index: testsuite/gcc.dg/tm/memopt-7.c =================================================================== --- testsuite/gcc.dg/tm/memopt-7.c (revision 183072) +++ testsuite/gcc.dg/tm/memopt-7.c (working copy) @@ -17,6 +17,6 @@ int f() return lala.x[asdf]; } -/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala" 1 "tmedge" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "lala = tm_save" 1 "tmedge" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala" 1 "tmedge" } } */ +/* { dg-final { scan-tree-dump-times "lala = tm_save" 1 "tmedge" } } */ /* { dg-final { cleanup-tree-dump "tmedge" } } */ Index: testsuite/gcc.dg/tm/memopt-4.c =================================================================== --- testsuite/gcc.dg/tm/memopt-4.c (revision 183072) +++ testsuite/gcc.dg/tm/memopt-4.c (working copy) @@ -19,6 +19,6 @@ int f() return lala.x[i]; } -/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala.x\\\[55\\\]" 1 "tmedge" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "lala.x\\\[55\\\] = tm_save" 1 "tmedge" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "tm_save.\[0-9_\]+ = lala.x\\\[55\\\]" 1 "tmedge" } } */ +/* { dg-final { scan-tree-dump-times "lala.x\\\[55\\\] = tm_save" 1 "tmedge" } } */ /* { dg-final { cleanup-tree-dump "tmedge" } } */ Index: trans-mem.c =================================================================== --- trans-mem.c (revision 183072) +++ trans-mem.c (working copy) @@ -1498,7 +1498,7 @@ requires_barrier (basic_block entry_bloc lower_sequence_tm altogether. */ needs_to_live_in_memory (x) /* X escapes. */ - || ptr_deref_may_alias_global_p (x)) + || may_be_aliased (x)) return true; else {