On Fri, Sep 12, 2014 at 2:14 PM, Bernd Schmidt <ber...@codesourcery.com> wrote:
> On 09/12/2014 01:45 PM, Richard Biener wrote:
>>
>> Fixing up the vector type in advance is ok with me but I'd like us to
>> move away from address-space-on-types.
>
>
> After thinking about it for a while, this idea makes no sense. Address
> spaces must be represented in the type system somehow - consider a pointer
> to an object in address space 0 vs. a pointer to an object in address space
> 1.  These are different types, they may even have different sizes.
>
> So by adding address spaces to references (_DECLs and _REFs) the only thing
> we'd accomplish is duplicating existing information, with enhanced chances
> of getting inconsistencies.

Well.  There are two parts of adress-space suport.  First is pointer
types which may have different size/mode.  Second is memory
references to different address-spaces which may require different
insns in the end (RTL).  On RTL we get away with "lowering"
pointers properly (the size/precision should be encoded correctly
on the tree/GIMPLE level as well).  And on RTL we have
the address-space of a MEM in its MEM_ATTRs.  On GIMPLE
we weirdly use some TYPE_QUALS on some type contained
in a memory reference tree.  I'd like to fix the latter by
placing address-space info on the reference itself (like on RTL),
not on the types.

Conveniently that would be on the base object we access
which is either a DECL or a MEM_REF/TARGET_MEM_REF.

Yes, the _frontends_ would be required to properly build
memory references to objects in different address-spaces.

Richard.

>
> Bernd
>

Reply via email to