From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,cf4ba3d07912d446 X-Google-Attributes: gid1164f8,public X-Google-Thread: 1094ba,cf4ba3d07912d446 X-Google-Attributes: gid1094ba,public From: "Jeffrey J. Potoff" Subject: Re: Mysterious data corruption in Fortran with -automatic Date: 1998/06/05 Message-ID: <35783CAA.C0907F50@rhea.umd.edu>#1/1 X-Deja-AN: 359909619 Content-Transfer-Encoding: 7bit References: <01bd9013$76f09aa0$6f242499@stupidwin95> <35774C1A.2985A59E@rhea.umd.edu> <01bd9039$7d242ba0$LocalHost@stupidwin95> <35780D53.849F9C05@ibm.net> Content-Type: text/plain; charset=us-ascii Organization: University of Maryland Mime-Version: 1.0 Newsgroups: comp.sys.dec,comp.lang.fortran Ian Pattie wrote: > > Well, I agree with Kevin. Jeffrey must be dealing with some pretty > simple codes or something. I write code in Fortran 90 for the Monte Carlo simulation of a variety of fluids. Most of my work is in the critical behavior of mixtures. The codes are not terribly complex (at least not to me), but can be quite long. They all compile with whatever optimization I choose and give me the exact same answers regardless of optimization level. All the codes I have written have always done that. If they didn't, I knew there was a bug (almost always in memory allocation) in the code. > > I can take 10 year old code, compile it with MS FPS (terrible, full > of bugs, especially when using automatic) Microsoft wrote a compiler, is it any suprise you found lots of bugs in it ? > and find optimization > bugs, in corrrect code. Lahey LF90 too (they finally just disabled > their -o2 flag) and DVF. > Look, I never said that there are *NO* compiler bugs, but in *most* cases bugs which appear due to higher optimization levels are due to sloppy written code. > In subroutines with 10 lines or 1000, it doesn't matter. Five compilers > will work fine, the 6th will stumble. Of course your code is the > first suspect, but in mature code that has worked fine for 10 years > or so, I usually end up finding an optimization bug. Worked fine on which platform with what platfrom specific extensions written around which compiler ? Jeff