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-Thread: 103376,7767a311e01e1cd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Fri, 20 Oct 2006 14:52:34 +0200 From: Gautier User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: GNAT compiler switches and optimization References: <1161341264.471057.252750@h48g2000cwc.googlegroups.com> In-Reply-To: <1161341264.471057.252750@h48g2000cwc.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 83.77.182.167 X-Original-NNTP-Posting-Host: 83.77.182.167 Message-ID: <4538c67e$1_2@news.bluewin.ch> X-Trace: news.bluewin.ch 1161348734 83.77.182.167 (20 Oct 2006 14:52:14 +0200) Organization: Bluewin AG Complaints-To: abuse@bluewin.ch X-Original-NNTP-Posting-Host: 127.0.0.1 Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wns13feed!worldnet.att.net!164.128.36.58!news.ip-plus.net!newsfeed.ip-plus.net!news.bluewin.ch!not-for-mail Xref: g2news2.google.com comp.lang.ada:7077 Date: 2006-10-20T14:52:34+02:00 List-Id: tkrauss wrote: > N := Positive'Value (Argument (1)); ... > for I in A'range(1) loop > for J in A'range(2) loop probably you have a penalty there against > do I = 1,N > do J = 1,N I guess the GNAT compiler can't tell that due to > A := new Real_Matrix(1..N, 1..N); esp. because alloc. is dynamic, you indeed have: for I in 1..N loop Then you should try that and even for I in reverse 1..N loop Perhaps g95 does that optimization when Ada has to stick with the mentioned direction. Also, compiling with -S and looking at the assembler code helps a lot... HTH, Gautier ______________________________________________________________ Ada programming -- http://www.mysunrise.ch/users/gdm/gsoft.htm NB: For a direct answer, e-mail address on the Web site!