steve@oakhill.UUCP (steve) (12/22/88)
So here are the results : (analysis follows) Computer Compiler Result Er Msg Comment -------------------------------- ---------------- ------ ----- ------- AT&T 3B1 - UNIX PC Model 7300 SVS FORTRAN Yes 2 AT&T 3B2/400 - 3B2/3B15 Computer FORTRAN 77 XLA+ 92 * Apollo DN 3000 Aegis 9.7 65785 * CRAY COS1.15 ? Yes 1 Cray CFT Yes 4 Cray CFT77 Yes 4 Cyber 205 Vsos 237 Yes 2 -------------------------------- ---------------- ------ ----- ------- Cyber 855 Nos 2.5.3 82 * Eta-10Q R0120N2 Yes 2 Harris H-800 VOS 7.1 sauf77 82 Yes Harris HCX-9 HCX/UX (unix) f77 82 No Harris HCX-9 HCX/UX (unix) hf77 92 No IBM PC/AT Professional FORTRAN Yes 2,5 ISTLA - Toolpack Static Analyser, Version 1.2 Yes 3 -------------------------------- ---------------- ------ ----- ------- Prime Fortran 66 92 * Prime Fortran 77 ? * 1 Pyramid OSX4.0 80 * Rolm 1666 Remora F77 (b-test) Yes 2 Rolm 1666 Remora F77 (b-test) 80 Yes 2,6 SUN OS 4.0 92 * SUN OS 4.2 rel 3.5 92 * -------------------------------- ---------------- ------ ----- ------- VAX/VMS 4.7 92 * *It should be pointed out that it is probably safe to assume if the result I recieved did not mention a warning message, the compiler probably did not generate one. Index to comments : 1 Infinite loop generated 2 Error reported from compiler - compiler produced no code. 3 Portability anaylzer, not compiler 4 Final answer not given in post. 5 Compiler made by Ryan-McFarland Corporation 6 Option to enable block jumping turned on. Ansi compatablity warning given. ----------------------------------------------------------------------------- Let us look at what the proper responses should be. There are actually three. The first is that the compiler can error out and produce no code. Of the compilers that were reported, five did this. One of these had a compiler option to compile through this, generating the next proper response, 80. 80 is the result that is generated when the outer do loop misses the K = K + 1 increment (as if a continue existed at that line). Only one other compiler generated this result. The other correct result is 82. This the 80 result plus two increments for K = K + 1 from the outer loop. Only three compilers got this answer. Of the wrong answers recieved, they fell into two catagories : 92 and infinitely large (or loops). 92 was the most common response to the code, given by six compilers. This leads me to suspect I fail to see what the code is to do, but I believe that these compilers do two increments on the internal loop jump-out. As for the infinite answers three computers answered this way. I generated this case knowing that on some compilers (specifically the Apollo), DO loops are generated technically wrong in order to make them perform extensions. Wish to thanks the following people for sending me results : Albert Hybl, PhD. Dept. Biophysics, U of Maryland School of Medicine Dan Packman NCAR Boulder, CO David Huelsbeck Los Alamos National Laboratory Mike McCants Execucom Systems Corp. Paul Hinker Eta Systems, Inc. Richard Brittain School of Elect. Eng. Cornell University enough from this mooncalf - Steven ---------------------------------------------------------------------------- These opinions aren't necessarily Motorola's or Remora's - but I'd like to think we share some common views. ---------------------------------------------------------------------------- Steven R Weintraub cs.utexas.edu!oakhill!devsys!steve Motorola Inc. Austin, Texas (512) 440-3023 (office) (512) 453-6953 (home) ----------------------------------------------------------------------------