From: rieachus@comcast.net
Subject: Re: Ada.Strings.Fixed.Count raises Storage_Error
Date: Fri, 1 Jul 2016 03:40:37 -0700 (PDT)
Date: 2016-07-01T03:40:37-07:00 [thread overview]
Message-ID: <d08efdc7-e640-4963-a527-3d033eefb979@googlegroups.com> (raw)
In-Reply-To: <dtjpj8Fsm6rU1@mid.individual.net>
On Thursday, June 30, 2016 at 1:38:50 AM UTC-4, Niklas Holsti wrote:
> Regarding Rosen's pathology, your explanation shows that it was a severe
> one and really required a change in the language definition. A different
> kind of thing than the possible problems of Strings extending to
> Integer'Last.
No it is not. There was a huge amount of wrangling about the consequences of the type Integer being 16-bits in size in Ada 83. The classic issue was that code for loops generated normally would never terminate for a loop over Integer'Range. (Strings were fine because they began at +1.)
Over the next few years, it became common for even Ada compilers for 16-bit word size systems to support a 32-bit Integer type. Then came machines with 64-bit integer registers and operations, and now, RM 3.5.4(11), Integer is a constrained subtype, and 64-bit registers can be used to count Integer loops without a problem. But the problem does come back for 64-bit or 128-bit or whatever types. No one is going to write a test which would outlast the physical machine, so we can ignore the issue--sort of. You can go write a loop that runs from System.Min_Int .. System.Max_Int and inspect the code generated to see if it is correct.
I consider this issue to be a subcase of this pathology. On machines with 64-bit registers and a 32-bit Integer type, the generated code should be fine.
next prev parent reply other threads:[~2016-07-01 10:40 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-12 11:36 Ada.Strings.Fixed.Count raises Storage_Error Xavier Petit
2016-05-12 15:22 ` Tero Koskinen
2016-05-12 22:05 ` Georg Bauhaus
2016-06-26 21:18 ` Victor Porton
2016-06-26 23:23 ` rieachus
2016-06-27 0:21 ` Jeffrey R. Carter
2016-06-27 4:00 ` rieachus
2016-06-27 0:51 ` Xavier Petit
2016-06-27 4:48 ` rieachus
2016-06-28 18:25 ` Xavier Petit
2016-06-29 18:49 ` Niklas Holsti
2016-06-29 19:40 ` Jeffrey R. Carter
2016-06-29 19:57 ` Dmitry A. Kazakov
2016-07-01 11:48 ` rieachus
2016-07-01 13:08 ` Dmitry A. Kazakov
2016-06-27 8:29 ` Simon Wright
2016-06-27 8:41 ` Georg Bauhaus
2016-06-29 8:15 ` Niklas Holsti
2016-06-29 9:13 ` J-P. Rosen
2016-06-29 17:43 ` Niklas Holsti
2016-06-29 18:19 ` J-P. Rosen
2016-06-29 20:30 ` Robert A Duff
2016-06-30 5:38 ` Niklas Holsti
2016-07-01 10:40 ` rieachus [this message]
2016-07-01 10:55 ` J-P. Rosen
2016-07-01 12:17 ` rieachus
2016-07-01 12:55 ` G.B.
2016-06-27 12:52 ` Victor Porton
2016-05-12 22:56 ` Randy Brukardt
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox