[cfe-commits] [PATCH] Fixing bug for function calls w/ diff addr spaces

Anton Lokhmotov Anton.Lokhmotov at arm.com
Fri Jun 15 07:43:04 PDT 2012



> -----Original Message-----
> From: Anton Lokhmotov [mailto:Anton.Lokhmotov at arm.com]
> Sent: 15 June 2012 15:34
> To: 'lattner at apple.com'
> Cc: cfe-commits at cs.uiuc.edu
> Subject: Re: [cfe-commits] [PATCH] Fixing bug for function calls w/
> diff addr spaces
> 
> Hi Tanya,
> 
> The code itself looks good to me.  But I'm worried why Clang thinks
> that dereferencing a pointer to a struct results in a value in the
> address space that the pointer points to.  A value is just a value, it
> shouldn't live in a particular address space:
> 
> __kernel void entry(__global int * buffer)
> {
>   const size_t gid = get_global_id();
>   int value = buffer[gid] * 2; // no address space
>   buffer[gid] = value;
> }
> 
> Can someone explain this please? (Assume that I know nothing - it's not
> that far from truth!)
> 
> Anton.







More information about the cfe-commits mailing list