home *** CD-ROM | disk | FTP | other *** search
- From: acmeyer@hpfcso.FC.HP.COM (Alan C. Meyer)
- Date: Sat, 25 Jul 1992 21:54:34 GMT
- Subject: Re: Re: why are fortran binaries so large?
- Message-ID: <9080024@hpfcso.FC.HP.COM>
- Organization: Hewlett-Packard, Fort Collins, CO, USA
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!hpscdc!hplextra!hpfcso!acmeyer
- Newsgroups: comp.lang.fortran
- References: <1992Jul24.170926.214@alchemy.chem.utoronto.ca>
- Lines: 39
-
- In comp.lang.fortran, system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson)) writes:
-
- > In article <OHL.92Jul23231746@ips105.desy.de> ohl@ips105.desy.de (Thorsten Ohl) writes:
- > >
- > >At least on Apollos and HP-UX boxes you can trick the compiler to
- > >allocate the offending array in the BSS segment by putting it into a
- > >COMMON block. Yes, it's a hack, but it can reduce the size of your
- > >binaries tremendously.
- >
- > If you use the '-K' option (to save and zero your variables), HP-UX
- > will always create a huge executable; Apollo/Domain, SGI and IBM
- > RS/6000 do not even when SAVE (or the compiler switch equivalent) is
- > used, unless of course DATA is used to actually initialize
- > the variables/arrays, when there is no alternative except to write
- > them into the executable. Otherwise the COMMON trick does the job.
-
- The large executable size with -K on HP-UX is a result of variables
- sometimes ending up in the data segment when they really belong in
- BSS. For example:
-
- REAL A(1000)
- REAL X(10)
- DATA X/10*1.0/
- ...
- END
-
- When compiled with -K, variable X should end up in the data segment, and
- variable A in BSS. However, both A and X may be put in data, causing the
- executable to be larger than necessary.
-
- This problem has been fixed in the HP-UX Fortran compiler and will
- ship with the next release.
-
- Alan Meyer
- Hewlett-Packard
- Colorado Language Lab
- acmeyer@fc.hp.com
-
- "These are my own opinions ..."
-