comp.lang.ada
 help / color / mirror / Atom feed
From: Mark Biggar <mark.a.biggar@attbi.com>
Subject: Re: Announce: The Ultimate SI Units Cracker
Date: Sun, 15 Sep 2002 00:24:15 GMT
Date: 2002-09-15T00:24:15+00:00	[thread overview]
Message-ID: <3D83D31C.4050809@attbi.com> (raw)
In-Reply-To: alvu9v$1hs7i$1@ID-77047.news.dfncis.de

Dmitry A.Kazakov wrote:
> Wes Groleau wrote:
> 
> 
>>"Dmitry A.Kazakov" wrote:
>>
>>>Then any discriminant-based solution faces the following problems:
>>>
>>>1. There is no way to force the compiler to remove statically known
>>>discriminants and calculate expressions on them at compile-time.
>>
>>I prefer to look at it as
>>"There's no rule to prevent a compiler vendor from ....
>> and no way to prevent a user from selecting that compiler."
> 
> 
> Is it absolutely true? I mean, ARM precisely defines what is "static" and 
> what is not. So an expression involving static discriminants could be 
> *formally* non-static, even if its outcome were known at compile-time. Thus 
> such an outcome would be not allowed to appear where a static value is 
> expected.

Yes, the ARM precisely defines which expressions must be static, but
it also goes on the define a "duck test"* for all expressions that
says that even though the expression is not in a static context
if it only contains static values then it should be statically
evaulated at compile time.  In addition, the optimization "as if" rule
allows a compiler to do all sorts of things like Wes wants.

* Duck Test: if it looks like a duck, has a bill, feathers, quacks, has 
webbed feet, etc., then it's a duck even if it appears where no duck
has ever been seen before.


-- 
Mark Biggar
mark.a.biggar@attbi.com




  reply	other threads:[~2002-09-15  0:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-12  8:11 Announce: The Ultimate SI Units Cracker Grein, Christoph
2002-09-12 10:14 ` Preben Randhol
2002-09-12 10:50 ` Jeffrey Creem
2002-09-12 14:06 ` Wes Groleau
2002-09-12 17:06   ` Randy Brukardt
2002-09-13 15:20     ` Wes Groleau
2002-09-13 20:54       ` Randy Brukardt
2002-09-13 22:09   ` Dmitry A.Kazakov
2002-09-13 15:26     ` Wes Groleau
2002-09-15  6:21       ` Dmitry A.Kazakov
2002-09-15  0:24         ` Mark Biggar [this message]
2002-09-16  1:35           ` Dmitry A.Kazakov
  -- strict thread matches above, loose matches on Subject: below --
2002-09-12 11:51 Grein, Christoph
2002-09-12 11:59 Grein, Christoph
2002-09-13  4:53 Grein, Christoph
2002-09-13 14:34 ` Ira Baxter
2002-09-13 20:50   ` Stephen Leake
2002-09-16 10:22   ` Fraser Wilson
2002-09-13 15:41 ` Wes Groleau
2002-09-13  5:34 Grein, Christoph
replies disabled

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