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: a07f3367d7,461d464a39a7a30a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,UTF8 X-Received: by 10.180.10.196 with SMTP id k4mr2906024wib.6.1367665796118; Sat, 04 May 2013 04:09:56 -0700 (PDT) Path: hg5ni66829wib.1!nntp.google.com!feeder1.cambriumusenet.nl!82.197.223.108.MISMATCH!feeder2.cambriumusenet.nl!feed.tweaknews.nl!193.141.40.65.MISMATCH!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!border4.nntp.ams.giganews.com!border2.nntp.ams.giganews.com!border3.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!backlog1.nntp.dca.giganews.com!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newsfeed.news.ucla.edu!nrc-news.nrc.ca!News.Dal.Ca!news.litech.org!news2.arglkargh.de!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!mx05.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Erroneous code generation from GNAT or GCC? Date: Tue, 30 Apr 2013 07:40:35 +0100 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Injection-Info: mx05.eternal-september.org; posting-host="32bbea2852c3ac5f339194c0aa5925ed"; logging-data="523"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+2u2FjHFfrYDlA9KF6Ys/7uFvUsx/+4tU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (darwin) Cancel-Lock: sha1:eMc0o7EqkaoLZ8VBdzC0k04vMC0= sha1:FModMHmNpo0g4wrKGUxP2xDjSOY= X-Original-Bytes: 3186 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2013-04-30T07:40:35+01:00 List-Id: "Yannick Duchêne (Hibou57)" writes: > Le Mon, 29 Apr 2013 03:35:53 +0200, Yannick Duchêne (Hibou57) > a écrit: >> If all parameters must be volatile when there address attribute is >> used, that implies systematic copy of everything, as types defined >> for Ada programs, are not to be volatile > Finally, this may be seen as a kind of representation conversion, > where copying to buffers before sending to the outside world is also > required. I suspect that the problem may be the 'clobber'. In [1], it says "You may not write a clobber description in a way that overlaps with an input or output operand. For example, you may not have an operand describing a register class with one member if you mention that register in the clobber list." So the clobber description is for registers that are overwritten implicitly. > Beside this, I noted something from the RM: > > http://www.adaic.org/resources/add_content/standards/05aarm/html/AA-13-8.html >> If a subprogram_body contains any code_statements, then >> within this subprogram_body the only allowed form of statement >> is a code_statement (labeled or not), the only allowed declarative_items >> are use_clauses, and no exception_handler is allowed (comments and >> pragmas >> are allowed as usual). > > This seems to mean object declarations are not allowed in this > context. But I did use object declarations in this context and GNAT > did not complained. Which is right and which is wrong? [2] says that the procedure version of the Asm subprograms "can be used anywhere a procedure call would be valid, and correspond to what the RM calls "intrinsic" routines. Such calls can be used to intersperse machine instructions with other Ada statements.". [1] http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gcc/Extended-Asm.html#Extended-Asm [2] http://gcc.gnu.org/onlinedocs/gcc-4.6.0/gnat_rm/Machine-Code-Insertions.html