This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Strange optimisation problem - gcc 4.3.2
- From: Andrew Haley <aph at redhat dot com>
- To: Mark Cave-Ayland <mark dot cave-ayland at siriusit dot co dot uk>
- Cc: gcc at gcc dot gnu dot org
- Date: Thu, 12 Nov 2009 10:27:31 +0000
- Subject: Re: Strange optimisation problem - gcc 4.3.2
- References: <4AFAE6A6.6020904@siriusit.co.uk>
Mark Cave-Ayland wrote:
So I'm really confused as to how adding a simply function pointer in the
global declaration section (without even adding any code to reference
it) suddenly incurs an extra 40% overhead? Can anyone explain why this
is, and/or point me to any suitable gcc optimisation guides?
There are a few possibilities, such as changing the alignment of the data,
but without seeing the code it's hard to say.
For reference, the gcc compiler is gcc 4.3.2 under Debian Lenny and the
compile flags are:
-Os -g -Wall -Wredundant-decls -Wshadow -Wpointer-arith
-Wstrict-prototypes -Wmissing-declarations -Wundef -Wendif-labels
-Wstrict-aliasing -Wwrite-strings -Wmissing-prototypes
We don't really have enough information. If you could provide the code
so that we can try it, we could help.
Andrew.