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 12:19:47 -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 19:19:48 +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; Response Message-ID: NNTP-Posting-Host: 85.210.60.99 X-Trace: sv3-xBCVUoT6Irv+Zfba/RZ+ywP8Mf83oU1EC+pRtBkB9+29rLDaIGzCDWUkC07ykmr/1J8qKDjHc9XVA+o!7/xU7KtG2YRXd/MI3Hpu4L0+VMffviLrSXA5ESFh42SCDUZXFeUMgiWCFzISeyCDWoE5UIr2JxA5!SO0vtHb9Vg== 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:3701 Date: 2006-04-01T19:19:48+01:00 List-Id: "Doobs" wrote in message news:SdmdndA2Z9jbI7PZnZ2dnUVZ8qWdnZ2d@pipex.net... > > "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... > Note that including a pragma import did NOT solve the problem - the code looked like this myX : MyRecordType; pragma volatile(myX); myY : MyArrayType; pragma volatile(myY); for myY'Address use myX'Address; pragma Import (Ada, myY); But the map file exhibited the same problem as before.