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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7e60c1d99ae3ffa1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-09-14 17:24:16 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!nntp-server.caltech.edu!attla2!ip.att.net!attbi_feed3!attbi.com!sccrnsc01.POSTED!not-for-mail Message-ID: <3D83D31C.4050809@attbi.com> From: Mark Biggar User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Announce: The Ultimate SI Units Cracker References: <3D809F51.299A6634@despammed.com> <3D8203A1.6931201A@despammed.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 12.235.91.30 X-Complaints-To: abuse@attbi.com X-Trace: sccrnsc01 1032049455 12.235.91.30 (Sun, 15 Sep 2002 00:24:15 GMT) NNTP-Posting-Date: Sun, 15 Sep 2002 00:24:15 GMT Organization: AT&T Broadband Date: Sun, 15 Sep 2002 00:24:15 GMT Xref: archiver1.google.com comp.lang.ada:28976 Date: 2002-09-15T00:24:15+00:00 List-Id: 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