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,b0a828f417615ded X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!d27g2000prf.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: Compiler Bug Date: Wed, 5 Dec 2007 08:07:54 -0800 (PST) Organization: http://groups.google.com Message-ID: <9984a3f8-1e45-44c0-96d6-4bd9462c57d5@d27g2000prf.googlegroups.com> References: <9f4bc0eb-d44a-43f9-83bd-dd07fa8538f2@i12g2000prf.googlegroups.com> <8a6283ea-be44-46d7-a2f1-a6d626266b58@p69g2000hsa.googlegroups.com> <97d0825d-ee08-45ef-b736-ca005caf1a81@e23g2000prf.googlegroups.com> <24d8f3b3-8406-4bc2-8908-f85c84a4bd69@e10g2000prf.googlegroups.com> <877ijtzd6q.fsf@willow.rfc1149.net> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1196870875 21387 127.0.0.1 (5 Dec 2007 16:07:55 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 5 Dec 2007 16:07:55 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: d27g2000prf.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18731 Date: 2007-12-05T08:07:54-08:00 List-Id: On Dec 5, 1:46 am, Samuel Tardieu wrote: > >>>>> "Adam" == Adam Beneschan writes: > > Adam> That's not true in reverse, by the way... there are legitimate > Adam> cases when adding an Inline pragma could make a Constraint_Error > Adam> go away, if an optimizer determines that some of the inlined > Adam> code can be eliminated for a particular call. > > Can you produce such an example? I am curious about it. I think this is such an example. It's possible that I'm technically wrong about what the language requires, though; if so, I'm hoping one of the other language experts will jump in. Some of the language rules about optimization have, I think, always been seen as a bit fuzzy. subtype Int10 is Integer range 1..10; procedure P1 (X : in Int10; Y, Z : out Int10) is begin Y := X + 1; Z := X + 5; end P1; procedure P2 is A1, A2, A3 : Int10; begin ... code whose effect puts the value 6 in A1 P1 (A1, A2, A3); ... code that uses A2 but does nothing with A3 end P2; Without any inlining, a Constraint_Error will surely be raised when P1 assigns to Z. If P1 is inlined, however, the compiler could change the call to P1 to code that, in effect, performs "A2 := A1 + 1; A3 := A1 + 5;"; then it could notice that since A3 is a local variable and is used in the remainder of P2, the assignment "A3 := A1 + 5" is pointless and can be eliminated---and thus the Constraint_Error would not be raised. I believe the Implementation Permissions of 11.6 allow this result. -- Adam