From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9296 invoked by alias); 16 Sep 2011 16:11:28 -0000 Received: (qmail 9287 invoked by uid 22791); 16 Sep 2011 16:11:26 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mms3.broadcom.com (HELO MMS3.broadcom.com) (216.31.210.19) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Sep 2011 16:11:12 +0000 Received: from [10.16.192.224] by MMS3.broadcom.com with ESMTP (Broadcom SMTP Relay (Email Firewall v6.3.2)); Fri, 16 Sep 2011 09:16:51 -0700 X-Server-Uuid: B55A25B1-5D7D-41F8-BC53-C57E7AD3C201 Received: from SJEXCHCCR02.corp.ad.broadcom.com ([10.16.192.130]) by SJEXCHHUB01.corp.ad.broadcom.com ([10.16.192.224]) with mapi; Fri, 16 Sep 2011 09:11:02 -0700 From: "Bingfeng Mei" To: "gcc@gcc.gnu.org" Date: Fri, 16 Sep 2011 16:11:00 -0000 Subject: Derive more alias information from named address space Message-ID: <7FB04A5C213E9943A72EE127DB74F0ADD15FCB0108@SJEXCHCCR02.corp.ad.broadcom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg00180.txt.bz2 Hi, I am trying to implement named address space for our target.=20 In alias.c, I found the following piece of code several times.=20 /* If we have MEMs refering to different address spaces (which can potentially overlap), we cannot easily tell from the addresses whether the references overlap. */ if (MEM_ADDR_SPACE (mem) !=3D MEM_ADDR_SPACE (x)) return 1; I think we can do better with the existing target hook: - Target Hook: bool TARGET_ADDR_SPACE_SUBSET_P (addr_space_t superset, addr= _space_t subset) If A is not subset of B and B is not subset of A, we can conclude they are either disjoint or overlapped. According to standard draft=20 (section 3.1.3), "For any two address spaces, either the address spaces must be disjoint, they must be equivalent, or one must be a subset of the other. Other forms of overlapping are not permitted." Therefore, A & B could only be disjoint, i.e., not aliased to each other. We should be able to write:=20 if (MEM_ADDR_SPACE (mem) !=3D MEM_ADDR_SPACE (x)) { if (!targetm.addr_space.subset_p (MEM_ADDR_SPACE (mem), MEM_ADDR_SPACE = (x)) && !targetm.addr_space.subset_p (MEM_ADDR_SPACE (x), MEM_ADDR_SPACE = (mem))) return 0; else return 1; } Is this correct? Thanks, Bingfeng Mei