From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,9b7034837b3fc85a X-Google-Attributes: gid1164f8,public X-Google-Thread: 1094ba,9b7034837b3fc85a X-Google-Attributes: gid1094ba,public From: lionel@quark.enet.dec.com (Steve Lionel) Subject: Re: F77, Errors when Optimizing on Alpha Date: 1995/08/12 Message-ID: <40ijko$ds6@nntpd.lkg.dec.com>#1/1 X-Deja-AN: 108033761 organization: Digital Equipment Corporation - Nashua, NH reply-to: lionel@quark.enet.dec.com newsgroups: comp.lang.fortran,comp.sys.dec In article <40g89i$h27@acmex.gatech.edu>, Steve Shepard wrote: >If the code is compiled using the standard F77 command, the results >obtained when runing the program are NOT ALWAYS CORRECT. In one code, the >results are correct with one loop of execution and incorrect on the next >loop. In this same code, the results are repeatable. That is, the Nth >loop always gives the same, incorrect, answer. > >If the code is compiled with OPTIMIZATION OFF (using -g option), the >results obtained when running the program are ALWAYS CORRECT. He set his posting for replies to go back to the poster, and I have sent him a more detailed answer, but I did want others to know that I had responded and to suggest what might be the problem. Here is part of what I wrote: One common programming error which can cause problems like this is violation of the Fortran 77 standard's prohibition against aliasing of dummy arguments and/or common. One way this often happens is to pass the same array or overlapping portions of the same array as two separate arguments to the same routine. The compiler assumes by default that you don't do this, and some significant optimizations take advantage of that knowledge. Unfortunately, without having seen the source code, I can only guess, but if the above is the problem, compiling with the -assume dummy_aliases switch will disable the optimizations which depend on the absence of dummy argument aliasing (storage association). Steve Lionel Mail: lionel@quark.enet.dec.com DEC Fortran Development WWW: http://www.digital.com/info/slionel.html Digital Equipment Corporation CompuServe: 75263,3001 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" For information on DEC Fortran 90, see http://www.digital.com/info/hpc/f90/