home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3355 < prev    next >
Encoding:
Internet Message Format  |  1992-09-01  |  1.7 KB

  1. Path: sparky!uunet!sun-barr!ames!lll-winken!sundance!jac@moonshine.llnl.gov
  2. From: jac@moonshine.llnl.gov (James A. Crotinger)
  3. Newsgroups: comp.lang.fortran
  4. Subject: Re: Small Language Wanted
  5. Message-ID: <jac.715382421@moonshine>
  6. Date: 1 Sep 92 21:20:21 GMT
  7. References: <DAVIS.92Aug23010605@pacific.mps.ohio-state.edu>     <H.3lvmyc56w&A@lionbbs.bs.open.de>     <1992Aug27.181926.5677@alchemy.chem.utoronto.ca>     <9224107.5975@mulga.cs.mu.OZ.AU> <DAVIS.92Aug27211418@pacific.mps.ohio-state.edu>
  8. Sender: news@sundance.llnl.gov (News Administrator)
  9. Organization: Magnetic Fusion Energy - LLNL
  10. Lines: 25
  11.  
  12. If you use Sun's ANSI C compiler, this works fine:
  13.  
  14.     gandalf:jac(tmp)> acc -o tc tc.c
  15.     gandalf:jac(tmp)> tc
  16.     16.000000 = pow(2.000000, 4)
  17.  
  18. It also works if you compile with a C++ compiler. However, I don't
  19. believe either of these compilers did the optimization in question,
  20. even after replacing 'i' with '4'. Doing 'nm' on the executable showed
  21. various entries having to do with logs and exponentials. I don't think
  22. these would have been there if the optimization had been done, but I'm
  23. not certain. They also appear in a similar executable based on the
  24. same program rewritten in Fortran.
  25.  
  26.   (One interesting note is that the Fortran executable was 188K while
  27. the C++ executable was only 32K. Fortran brings in a lot of unnecessary
  28. garbage for such a simple program. Granted this has nothing to do with
  29. real programs. It is just an parenthetical note 8-).)
  30.  
  31.   Jim
  32. --
  33. -------------------------------------------------/\--------------------------
  34. James A. Crotinger     Lawrence Livermore N'Lab // \ The above views are mine
  35. jac@moonshine.llnl.gov P.O. Box 808;  L-630 \\ //---\  and are not neces-
  36. (510) 422-0259         Livermore CA  94550   \\/Amiga\  sarily those of LLNL.
  37.