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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,4eca860272d4832b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail NNTP-Posting-Date: Tue, 06 Feb 2007 21:32:22 -0600 From: "Steve" Newsgroups: comp.lang.ada References: <12shen4qjhv41a7@corp.supernews.com> <1170792077.235994.10900@q2g2000cwa.googlegroups.com> Subject: Re: Static vs dynamic evaluation anomaly? Date: Tue, 6 Feb 2007 19:32:57 -0800 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3028 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 X-RFC2646: Format=Flowed; Original Message-ID: NNTP-Posting-Host: 24.20.111.245 X-Trace: sv3-aI9j3iN3+5kfY7aDVEYhN/0WoANJB6Oy+hjvQRCa2za7+T9AOJpccRe5dvKlwC9btGlMhZ6xY/V3QBK!Vd/YLqrZzyC+UdbXIPIGxxVprADHG8HCqnnsBKvyWobyBGT0lhOjmripjXPcGlfknpEtfmiRX/vJ!xsdi3qSG2JpJzw== X-Complaints-To: abuse@comcast.net X-DMCA-Complaints-To: dmca@comcast.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: g2news2.google.com comp.lang.ada:9043 Date: 2007-02-06T19:32:57-08:00 List-Id: "Adam Beneschan" wrote in message news:1170792077.235994.10900@q2g2000cwa.googlegroups.com... > On Feb 6, 9:29 am, Matt Jaffe wrote: > >> Any further help in explaining these anomalies would be much appreciated. >> (It's always possible we've stumbled across a compiler bug; but I am >> reluctant to come to that conclusion prematurely.) > > I'm not so reluctant. It's a compiler bug. > > The following program produces incorrect results on GNAT, or at least > on the version I'm using: > > with Ada.Text_IO; > procedure test271 is > type Six_Bits is mod 2**6; > package Six_Bit_IO is new Ada.Text_IO.Modular_IO(Six_Bits); > X : Six_Bits := 31; > begin > for J in 0..5 loop > Ada.Text_IO.Put ("When J=" & Integer'image(J)); > Ada.Text_IO.Put (", X*2**J ="); > Six_Bit_IO.Put(X*2**J); > Ada.Text_IO.New_Line; > end loop; > end test271; > One more data point... ObjectAda 7.2.2 gives the result: When J= 0, X*2**J = 31 When J= 1, X*2**J = 62 When J= 2, X*2**J = 60 When J= 3, X*2**J = 56 When J= 4, X*2**J = 48 When J= 5, X*2**J = 32 Which I believe is correct, Regards, Steve (The Duck) > -- Adam >