comp.lang.ada
 help / color / mirror / Atom feed
From: "Yannick Duchêne (Hibou57)" <yannick_duchene@yahoo.fr>
Subject: Re: GNAT not generating any code for sub‑program: known bug?
Date: Sun, 28 Apr 2013 21:27:22 +0200
Date: 2013-04-28T21:27:22+02:00	[thread overview]
Message-ID: <op.wv9mzwv5ule2fv@cardamome> (raw)
In-Reply-To: op.wv9ilgizule2fv@cardamome

Le Sun, 28 Apr 2013 19:52:18 +0200, Yannick Duchêne (Hibou57)  
<yannick_duchene@yahoo.fr> a écrit:
> I still feel that looks like a compiler bug (GCC's fault or GNAT's  
> fault?).

That's me who bugged and that's my fault :D

Explanations with two points.

1) In the archive linked in this thread, if I change `Volatile => False`  
into `Volatile => True`, it works, without even a need to use `Clobber`.  
Thus, the initial case is solved.

2) In a later message I tried something else, with `Volatile => True`,  
this did not work neither as I said, while it should have work. That was  
because something else also changed: the package specification hold a  
`pragma Pure;` and that was wrong [1]. I changed `pragma Pure;` into  
`pragma Preelaborate;` and it now works as expected.


[1]: http://www.ada-auth.org/standards/12rm/html/RM-10-2-1.html#p18
> If a library unit is declared pure, then the implementationis permitted  
> to omit a call on a library-level subprogramof the library unit if the  
> results are not needed after thecall. In addition, the implementation  
> may omit a call on sucha subprogram and simply reuse the results  
> produced by an earliercall on the same subprogram, provided that […]

That's a quoted from “Implementation permissions”, and I forget it. Well,  
honestly, I believe this should part of the semantic. If you read the  
semantic part (above), which is what I typically focus on, nothing there  
implies or even suggest this implementation permission. The semantic part  
should have an explicit reference to side effects, and not just  
elaboration. By the way, the whole page is titled “Elaboration Control”,  
not “Sub‑program invocation semantic”. It's unlikely someone will search  
in elaboration control to learn about sub‑program call semantic, these are  
two different things. Well, that's a personal opinion, and I may be wrong  
with it (if so, please, tell me why).


-- 
“Syntactic sugar causes cancer of the semi-colons.” [1]
“Structured Programming supports the law of the excluded muddle.” [1]
[1]: Epigrams on Programming — Alan J. — P. Yale University



  reply	other threads:[~2013-04-28 19:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 21:08 GNAT not generating any code for sub‑program: known bug? Yannick Duchêne (Hibou57)
2013-04-27 22:22 ` Yannick Duchêne (Hibou57)
2013-04-27 23:48   ` Yannick Duchêne (Hibou57)
2013-04-28  7:14   ` Simon Wright
2013-04-28 17:52     ` Yannick Duchêne (Hibou57)
2013-04-28 19:27       ` Yannick Duchêne (Hibou57) [this message]
2013-04-28 20:46         ` Simon Wright
2013-04-28 20:43       ` Simon Wright
2013-04-28 22:35 ` Erroneous code generation from GNAT or GCC? Yannick Duchêne (Hibou57)
2013-04-28 22:49   ` Yannick Duchêne (Hibou57)
2013-04-28 23:52   ` Yannick Duchêne (Hibou57)
2013-04-29  1:35     ` Yannick Duchêne (Hibou57)
2013-04-30  0:48       ` Yannick Duchêne (Hibou57)
2013-04-30  6:40         ` Simon Wright
2013-04-30 17:04           ` Yannick Duchêne (Hibou57)
2013-04-30 19:06             ` Simon Wright
2013-04-30 21:28               ` Yannick Duchêne (Hibou57)
2013-04-30 22:22                 ` Simon Wright
2013-05-01 18:19               ` J-P. Rosen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox