This is the mail archive of the
mailing list for the GCC project.
Re: Inefficient code generation with -fPIC.
- To: suckfish at ihug dot co dot nz
- Subject: Re: Inefficient code generation with -fPIC.
- From: suckfish at ihug dot co dot nz
- Date: Mon, 13 Nov 2000 22:24:51 +1300 (NZDT)
- Cc: gcc at gcc dot gnu dot org
- References: <firstname.lastname@example.org>
Earlier I wrote:
>I've got a problem with with -fPIC on i386 generating inefficient code.
I've tracked the problem down & submitted a bug report.
The problem can be illustrated by compiling the following with
g++ -S -fPIC -O2:
What seems to be happening is this: the exception spec causes the
generation of exception handling code that requires the GOT. The
exception handling code gets optimised way, but the GOT computation
Easy work around: omit the exception specification. [This is quite
counter-intuitive; I'd added the throw() to some performance critical
code thinking that it might help the compiler generate better code...]