From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22629 invoked by alias); 6 Jun 2011 15:16:38 -0000 Received: (qmail 22581 invoked by uid 22791); 6 Jun 2011 15:16:36 -0000 X-SWARE-Spam-Status: No, hits=1.3 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-yx0-f175.google.com (HELO mail-yx0-f175.google.com) (209.85.213.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 06 Jun 2011 15:16:22 +0000 Received: by yxi11 with SMTP id 11so1319706yxi.20 for ; Mon, 06 Jun 2011 08:16:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.109.130 with SMTP id s2mr6666468yhg.245.1307373380832; Mon, 06 Jun 2011 08:16:20 -0700 (PDT) Received: by 10.147.32.17 with HTTP; Mon, 6 Jun 2011 08:16:20 -0700 (PDT) In-Reply-To: References: Date: Mon, 06 Jun 2011 19:33:00 -0000 Message-ID: Subject: Re: about named address space From: Rony Paul To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00118.txt.bz2 On Mon, Jun 6, 2011 at 11:34 AM, Rony Paul wrote: > On Fri, May 27, 2011 at 4:51 PM, Ian Lance Taylor wrote: >> Rony Paul writes: >> >>> suppose I have the following piece of code in my program. >>> >>> =A0 extern =A0int __ea x; >>> =A0 int y; >>> =A0 y =3D x; >>> >>> that means I am copying data from one address space to another. >>> in that case will the method spu_addr_space_convert (rtx op, tree >>> from_type, tree to_type); =A0be called by the compiler? >>> in the spu.c file the defination of " spu_addr_space_convert " is >>> given. but when and under which condition they will be called ? >> >> I'm pretty sure it won't be called. =A0That function converts a pointer = to >> one address space into a pointer to a different address space. =A0No such >> conversion is happening here. >> >>> where >>> is it defined? >> >> The function spu_addr_space_convert is the SPU-specific implementation >> of the target hook TARGET_ADDR_SPACE_CONVERT which is documented in the >> section on named address spaces. >> >> Ian >> > > > Then if I want to prevent these type of copying data from one address > space to another (ie. I dont want to allow these type of copy > operation in my application). where should I write code in GCC > compiler? > > Actually I can define different address space, but still I cant store > there data in different byte order. would you give me any idea about > how to store data in different byte order in different address space? > > -Rony > =A0please suggest me, > in c-type.c file there are some code like : =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D asl =3D TYPE_ADDR_SPACE (ttl); asr =3D TYPE_ADDR_SPACE (ttr); if (!null_pointer_constant_p (rhs) && asr !=3D asl && !targetm.addr_space.subset_p (asr, asl)) { switch (errtype) { case ic_argpass: error_at (location, "passing argument %d of %qE from pointer to " "non-enclosed address space", parmnum, rname); break; case ic_assign: error_at (location, "assignment from pointer to " "non-enclosed address space"); break; case ic_init: error_at (location, "initialization from pointer to " "non-enclosed address space"); break; case ic_return: error_at (location, "return from pointer to " "non-enclosed address space"); break; default: gcc_unreachable (); } return error_mark_node; } -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D and in my program if I write code like, __ea int * p =3D malloc_ea(sizeof(int)); int * v; p=3Dv; this returns error message "assignment from pointer to non-enclosed address space" so, this checking for pointer of the different address space is done for pointer. now if I want to add this check for data variable also, what should I do. I cant understand, would you please help me? ie. I want to write code like extern int __ea x; int y; and it should give error message like "assignment from variable to non-enclosed address space" Thanks