This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Inefficient code generation with -fPIC.


Hi,

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:

int f()throw(){}

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
remains.

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...]

Ralph.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]