[comp.sys.apollo] cc -g makes programs run faster?

hamm@austoto.sps.mot.com (Steve Hamm) (09/17/90)

Serious strangeness:  We're compiling our program for
debugging, under SR10.1 BSD, cc 6.7, on a 4500.  The compile
flags normally look like: 

         -A cpu,3000 -W0,-opt,4 -D_BUILTINS

When we change them to

         -g -A cpu,3000 -W0,-opt,4 -D_BUILTINS

the program runs about three times faster. (It also grows from
1.8meg to about 10meg.)

We are attempting to debug some problems that move around depending
on what level of optimization we use, so we suspect some wonky
behavior on the part of the compiler.  But...  anyone know
of a reason why including the extra symbol information and
expanding the binary size by 5 times should SPEED UP a program?

--
Steve Hamm ----------- Motorola Inc. Semiconductor Sector CAD  
                       3501 Ed Bluestein Blvd., MD-M2, Austin TX 78762
Ph: (512) 928-6612     Internet:  hamm@austoto.sps.mot.com   
                       UUCP:      ...cs.utexas.edu!oakhill!austoto!hamm

glenn@huxley.huxley.bitstream.com (Glenn P. Parker) (09/18/90)

In article <HAMM.90Sep17094745@toto.austoto.sps.mot.com>,
hamm@austoto.sps.mot.com (Steve Hamm) writes:
>                                        But...  anyone know
> of a reason why including the extra symbol information and
> expanding the binary size by 5 times should SPEED UP a program?

So, have you tried running "strip" on the resulting binary?
This might isolate the difference between just having extra symbol table
information vs. some real difference in the compiled code.
--
--------------------------------------------------------------------------
Glenn P. Parker        Bitstream, Inc.
uunet!huxley!glenn     215 First Street
glenn@bitstream.com    Cambridge, MA 02142-1270

krowitz@RICHTER.MIT.EDU (David Krowitz) (09/18/90)

A factor of three speed increase (for floating point code) is usually
what I get from going from a " cpu any" (the default) to a "cpu 3000"
(which turns on the use of inline floating point code and the 68020
specific addressing modes). It's mere speculation, but maybe your
"cpu,3000" isn't getting through to the compiler in the first case?
You can use the Apollo specific switch "exp" to get an expanded assembly
code listing which should show you whether the code generated is using
68020/68881 floating point and address modes, or whether it's using
calls to the floating point library and default 68000 address modes.


 -- David Krowitz

krowitz@richter.mit.edu   (18.83.0.109)
krowitz%richter.mit.edu@eddie.mit.edu
krowitz%richter.mit.edu@mitvma.bitnet
(in order of decreasing preference)

rehrauer@apollo.HP.COM (Steve Rehrauer) (09/19/90)

In article <9009181421.AA22513@richter.mit.edu> krowitz@RICHTER.MIT.EDU (David Krowitz) writes:
>A factor of three speed increase (for floating point code) is usually
>what I get from going from a " cpu any" (the default) to a "cpu 3000"
>(which turns on the use of inline floating point code and the 68020
>specific addressing modes). It's mere speculation, but maybe your
>"cpu,3000" isn't getting through to the compiler in the first case?

To verify that this is or isn't the case, you could try specifying
-## or -### to /bin/cc.  The former causes the expanded command-line
that is actually passed to /com/cc to be echoed before compilation
proceeds.  The latter just echoes the command-line, without proceeding
with compilation.
--
   >>"Aaiiyeeee!  Death from above!"<<     | (Steve) rehrauer@apollo.hp.com
"Spontaneous human combustion - what luck!"| Apollo Computer (Hewlett-Packard)