From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,afb4d45672b1e262 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.pipex.net!news.pipex.net.POSTED!not-for-mail NNTP-Posting-Date: Sat, 01 Apr 2006 11:54:14 -0600 Reply-To: "Doobs" From: "Doobs" Newsgroups: comp.lang.ada References: <87odzl5ilt.fsf@mid.deneb.enyo.de> Subject: Re: Any way of persuading GNAT/GCC to implement a true overlay and not a pointer? Date: Sat, 1 Apr 2006 18:54:16 +0100 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 85.210.60.99 X-Trace: sv3-3XJF0PKhHfVyZ53G9awN11WLwkbKzDdtfzKuDlky+s4fay+P7TYptvykLHoXqcfwg18XAGJozhbamkW!DjcpudoeFmQfzdG25K4l9H2pM4vGTBruiwtrRAwZSUUcT8477bzWLXPStUTvMlzh9+FCFpoT1xnD!zpRRwavpck2csgS2bQglJUU= X-Complaints-To: abuse@dsl.pipex.net X-DMCA-Complaints-To: abuse@dsl.pipex.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:3699 Date: 2006-04-01T18:54:16+01:00 List-Id: "Florian Weimer" wrote in message news:87odzl5ilt.fsf@mid.deneb.enyo.de... >> I was under the impression that code of the following form : >> >> X : ; >> Y : ; >> for Y'Address use X'Address; >> >> would result in an overlay in the resulting code. > > Could you show some more code? Probably initialization is causing > your problems, which can be fixed with a pragma Import. The following is an example of the problem: package TestPackage is type MyRecordType is record element1 : Positive; element2 : Positive; end record; type MyArrayType is array(1..2) of Positive; myX : MyRecordType; pragma volatile(myX); myY : MyArrayType; pragma volatile(myY); for myY'Address use myX'Address; end TestPackage; The following fragments of the resulting MAP file (GCC 3.4.2 mingw32) show the problem... .data 0x00472b00 0x10 ./testpackage.o 0x00472b00 testpackage__myy .data 0x00472b10 0x10 ./nextpackage.o <..... later in the file...> COMMON 0x004a2770 0x20 ./testpackage.o 0x004a2770 testpackage__myx 0x004a2780 testpackage_E Clearly myX and myY do NOT share the same address. I am also puzzled as to why the variables have been put in differen memory sections...