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: "Kevin G. Rhoads" Subject: Re: Mysterious data corruption in Fortran with -automatic Date: 1998/06/04 Message-ID: <01bd9038$56a0f7c0$LocalHost@stupidwin95>#1/1 X-Deja-AN: 359711488 References: <01bd9013$76f09aa0$6f242499@stupidwin95> <35774C1A.2985A59E@rhea.umd.edu> Newsgroups: comp.sys.dec,comp.lang.fortran >I disagree. Most likely you have hit a 'bug', but it's not the >compiler that's the problem, it's the code itself. For well >written code you can compile it with *any* flags on *any* platform >and it still runs without incident. When something adds 2 + 2 and gives me -123e+78, it is the compiler which has OVER-optimized the code to the point where it is generating garbage. If you were to say, that well written code SHOULD be able to be compiled with any flags on any platform and run with correct output, then I would agree. I have seen TOO many cases where the COMPILER is in error. I don't trust my code. I don't trust the compiler's libraries. I don't trust the compiler's code generator. I try my best to VERIFY all of these. If something screwy happens, I check my code first. But I don't continue assuming it is my problem forever. I also check to see if the problem changes or goes away if I change platforms, compilers and compiler settings. Even if it is an error in my code, changing these other things can provide useful information helping to locate the problem. But when my code compiles cleanly under 6 different compilers. And it generates the same output from the exes from 5 of those compilers no matter what settings I use in any of those five compilers, but with the exe from the sixth compiler it sometimes works fine but when compiled with other settings it produces total garbage -- that is fairly solid evidence that compiler number 6 has a bug. I have been programming for over 30 years, and I have seen a fair number of compiler bugs. If you have tools sets whose quality justifies your unreserved faith in their correctness, you are lucky! As for me, I trust, but I verify. -- Kevin G. Rhoads, Ph.D. T_Rhoads@NO_SPAM.Classic.MSN.COM KRhoads@NO_SPAM.CmpNetMail.com