home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!ames!lll-winken!sundance!jac@moonshine.llnl.gov
- From: jac@moonshine.llnl.gov (James A. Crotinger)
- Newsgroups: comp.lang.fortran
- Subject: Re: Small Language Wanted
- Message-ID: <jac.715382421@moonshine>
- Date: 1 Sep 92 21:20:21 GMT
- 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>
- Sender: news@sundance.llnl.gov (News Administrator)
- Organization: Magnetic Fusion Energy - LLNL
- Lines: 25
-
- If you use Sun's ANSI C compiler, this works fine:
-
- gandalf:jac(tmp)> acc -o tc tc.c
- gandalf:jac(tmp)> tc
- 16.000000 = pow(2.000000, 4)
-
- It also works if you compile with a C++ compiler. However, I don't
- believe either of these compilers did the optimization in question,
- even after replacing 'i' with '4'. Doing 'nm' on the executable showed
- various entries having to do with logs and exponentials. I don't think
- these would have been there if the optimization had been done, but I'm
- not certain. They also appear in a similar executable based on the
- same program rewritten in Fortran.
-
- (One interesting note is that the Fortran executable was 188K while
- the C++ executable was only 32K. Fortran brings in a lot of unnecessary
- garbage for such a simple program. Granted this has nothing to do with
- real programs. It is just an parenthetical note 8-).)
-
- Jim
- --
- -------------------------------------------------/\--------------------------
- James A. Crotinger Lawrence Livermore N'Lab // \ The above views are mine
- jac@moonshine.llnl.gov P.O. Box 808; L-630 \\ //---\ and are not neces-
- (510) 422-0259 Livermore CA 94550 \\/Amiga\ sarily those of LLNL.
-