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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,7ea331d974cf3d8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-02-24 09:03:03 PST Path: nntp.gmd.de!news.rwth-aachen.de!news.rhrz.uni-bonn.de!RRZ.Uni-Koeln.DE!uni-duisburg.de!zib-berlin.de!news.mathworks.com!newshost.marcam.com!uunet!in1.uu.net!newsgate.watson.ibm.com!watnews.watson.ibm.com!ncohen From: ncohen@watson.ibm.com (Norman H. Cohen) Newsgroups: comp.lang.ada Subject: Re: Ada and Number Crunching ? Date: 24 Feb 1995 17:03:03 GMT Organization: IBM T.J. Watson Research Center Distribution: world Message-ID: <3il3g7$1m00@watnews1.watson.ibm.com> References: <3iatre$3t1m@lamar.ColoState.EDU> <3ikfqg$6ar@fang.dsto.gov.au> Reply-To: ncohen@watson.ibm.com NNTP-Posting-Host: rios8.watson.ibm.com Date: 1995-02-24T17:03:03+00:00 List-Id: In article <3ikfqg$6ar@fang.dsto.gov.au>, sxc@itd.dsto.gov.au writes: |> Actually, I think that Vladimir has an interesting point |> |> Approximately equivalent Ada and C++ programs, when compiled with |> compilers that use the same backend / optimiser technology, seem |> to run in approximately the same time. |> |> Now if there was some way to remove some of the hand-waves in the |> above, he may be able to arrive at a meaningful datapoint. For |> example: ... |> 2) Are the back-end optimisers really identical? (Do they do |> any C++ or Ada specific optimisation?) Ada provides opportunities for optimization that C++ does not, including: o Better aliasing information. If an untagged Ada global variable is not marked "aliased", assignment to X.all, where access value X points to the same type, cannot possibly kill the global variable, and vice versa. o Information provided by constraints. This can be effectively exploited to eliminate redundant constraint checks. (In C++, if constraint checking is performed, it is done by explicit programming, and the compiler may be unable to deduce that a check is unnecessary because a redundant check was performed earlier. If a C++ program does not perform run-time checking, the only fair comparison is with an Ada program compiled with checks suppressed, in which case Ada constraint information may still provide an advantage, but not as big an advantage.) Optimizing back ends used for multiple languages typically rely on the front end to provide aliasing information. My understanding is that the gcc back end also has a hook for the front end to provide range information. Does gnat provide this information to the back end, and does the back end exploit it effectively? -- Norman H. Cohen ncohen@watson.ibm.com