Re: short pointers (32 bit) in 64 bit apps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Reza Roboubi <reza@xxxxxxxxxx> writes:

> Ian Lance Taylor wrote:
>> Reza Roboubi <reza@xxxxxxxxxx> writes:
>>
>>> Is there support for "short" pointers in 64 bit applications?  As
>>> struct members, these short pointers would save space, but when
>>> accessed, they would automatically be treated as 64 bit pointers into
>>> the "current" 4GB space (namely where the containing struct resides.)
>>
>> No.
>>
>> Sorry.
>>
>> Ian
>
> Do you know what it takes to do it?  How much work for a newcomer to
> get up to speed with gcc?  (Maybe this should go to the developer
> list?)

At first glance the proposed optimization seems clearly unsafe.  There
is nothing which limits a pointer to pointing into any particular 4GB
space.

If you want to limit this to struct members, you would essentially
want to rewrite struct fields with pointer type to have some different
type instead.  You would need to automatically convert values on load
and store.  It seems doable to me.  You would probably want to change
the handling of fields in stor-layout.c and change the way that
COMPONENT_REF trees are geneated.

gcc is a complex program, and some newcomers do have difficulty
understanding it.

Ian

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux