Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?



I was under the impression that code of the following form :

X : <Some Type>;
Y : <Some Type>;
for Y'Address use X'Address;

would result in an overlay in the resulting code. However on a project
where external test equipment showed that the contents of X were NOT the
same as Y I investigated further. I checked on both a Windows host version
of GCC (3.4.2) and a target cross compiler (GCC 3.4.4) and on both the
construct above is actually implemented using indirection (a pointer). The
map file and symbol table show that irrespective of the data type and size
of Y it is always implemented as a pointer to X. Although this appears
semantially identical to an overlay as far as the progam is concerned it is
NOT identical as far as an external observer is concerned. I have a bit
packed record which I wanted to return as an array of longwords to pretty
dumb test equipment. The easiest way *would* be to overlay a longword
array - however this would not appear to be possible.....



.



Relevant Pages

  • Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer?
    ... would result in an overlay in the resulting code. ... Tried Pragma volatile - had no effect..... ... Even though Y is a large array in my implementation, ... run time it contains the address of X - i.e. it is a pointer to X ...
    (comp.lang.ada)
  • Re: Records that could be arrays
    ... I'm not recommending anyone actually use the 'Address overlay, ... and even then I'd probably say no: pick record or array. ... You said it was an Ada language limitation that you couldn't use ... representation is NOT the case, I'd hate to think of the inefficiency ...
    (comp.lang.ada)
  • Re: Base64-Encoding
    ... is only defined for record types. ... indeed GNAT refuses to accept a 'Bit_Order on Six_Bits or the array ... My basic idea is to define an array of Six_Bits and "overlay" this at ...
    (comp.lang.ada)
  • Cursor Problem When Overlaying Image with Numbers and Using Area Maps
    ... I have an application where I display an image, overlay the image with numbers, and then define map areas that open new windows when the map area is clicked. ... but the mouse pointer changes to the text cursor and the mapping function does not operate when the pointer is on the overlaid text. ...
    (comp.lang.javascript)
  • Re: Problem With Title Overlay on WMM
    ... on WMM bleeding from one pix to another. ... Place your pointer on the Title Overlay and you ... looks like a hand you can left click/drag the overlay ...
    (microsoft.public.windows.vista.music_pictures_video)