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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,40bf3d9b43d88cff X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: Samuel Tardieu Newsgroups: comp.lang.ada Subject: Re: Access to fixed memory location References: <4750654d$0$13115$9b4e6d93@newsspool2.arcor-online.net> Date: Fri, 30 Nov 2007 22:42:09 +0100 Message-ID: <87wsrz1kcu.fsf@willow.rfc1149.net> User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:bnhbYyJ604zvheA6QNurnJPuLTU= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Leafnode-NNTP-Posting-Host: 2001:6f8:37a:2::2 Organization: Guest of ProXad - France NNTP-Posting-Date: 30 Nov 2007 22:45:01 MET NNTP-Posting-Host: 88.191.14.223 X-Trace: 1196459101 news-1.free.fr 26660 88.191.14.223:48842 X-Complaints-To: abuse@proxad.net Path: g2news1.google.com!news1.google.com!news2.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx01.iad01.newshosting.com!newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!oleane.net!oleane!feed.ac-versailles.fr!news.ecp.fr!club-internet.fr!feedme-small.clubint.net!proxad.net!feeder1-1.proxad.net!cleanfeed4-b.proxad.net!nnrp17-1.free.fr!not-for-mail Xref: g2news1.google.com comp.lang.ada:18684 Date: 2007-11-30T22:45:01+01:00 List-Id: >>>>> "Tomas" == Tomas Cernaj writes: Tomas> That's because the compiler can not assume that Y'Address will Tomas> not be changed. Well, no, that's not the reason (Y'Address is obviously static and constant). This is due to an unfortunate combination of three things: a) because of RM13.3(19), no optimization can be done on Y based on assumptions of no aliases b) to implement this clause, GCC marks the implicitly defined pointer type as volatile c) when this implicitly defined pointer type is marked as volatile, GCC generates code which does read+modify+write here at 3 separate operations rather than using an atomic one I think GNAT is overconservative concerning (b) as I do not think a volatile behaviour is mandated here, and that (c) could generate a better code but this is a separate issue from (b). Sam -- Samuel Tardieu -- sam@rfc1149.net -- http://www.rfc1149.net/