confirm subscribe to gcc-help@gcc.gnu.org

Rob Curtis RobC@norseld.com
Wed Jan 29 04:28:00 GMT 2003


Hi Folks, 
We are cross-compiling for the Hitachi H8 micro for a little embedded
project.

Much of the source code functions are never called and I expected the
compiler to optimise these functions away but reading through through
some of the output I get references to functions that never get called
(and have no pointers to them). 
I'm no expert at gcc. Can someone tell me what output I should be
looking at to see how the optimisation has gone?
Our little embedded micro is full and I need to write still more code.

The compile options (sucked out of our make file) are:

CFLAGS=-g -m$(ARCH) -O2 -fsigned-char -pedantic -malign-300 -fno-common
-fshort-enums -Wall

I thought the -g flag was to add debugger code but it doesn't seem to
make any difference.
It seems that constant strings are the culprit. I removed some and the
build is OK, and I can add up to a certain size without it blowing up.
Reduce the size of the string by a few bytes and still put in a 200
instruction function and it still survives. P.S. the huge string that
causes it to blow up is in a function that has no reference to its
address (and so I thought it should be removed).

Any help would be much appreciated.

Regards,

Rob Curtis
   ___________________
|=/__________________/=|=====()>
Norseld Laser & Control P/L



More information about the Gcc-help mailing list