From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1094ba,cf4ba3d07912d446 X-Google-Attributes: gid1094ba,public X-Google-Thread: 1164f8,cf4ba3d07912d446 X-Google-Attributes: gid1164f8,public From: "Jeffrey J. Potoff" Subject: Re: Mysterious data corruption in Fortran with -automatic Date: 1998/06/05 Message-ID: <35783599.98D4220F@rhea.umd.edu>#1/1 X-Deja-AN: 359903682 Content-Transfer-Encoding: 7bit References: <01bd9013$76f09aa0$6f242499@stupidwin95> <35774C1A.2985A59E@rhea.umd.edu> <01bd9036$7ae7fea0$LocalHost@stupidwin95> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: University of Maryland Newsgroups: comp.sys.dec,comp.lang.fortran Kevin G. Rhoads wrote: > > Please read what I wrote and respond to that. > > If the code gives CORRECT answers with compiler > optimizations OFF and it gives WRONG answers > with compiler optimizations ON -- question, where > is the bug? > In your code. > Answer, in the compiler optimizations -- the code > did NOT change, the compiler did. The way the program accesses memory will change due to the optimization level (ie, the code gets reorganized). If you don't initialize your variables or pass them correctly to subroutines the optimized code can give incorrect results or may not run at all. Well written code will not suffer from these problems. Jeff