This is the mail archive of the
gcc@gcc.gnu.org
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: Joe Buck <jbuck at localhost dot localdomain>
- Date: Mon, 13 Nov 2000 09:35:49 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org
> 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...]
If a function specifies throw() and calls other functions, it has to
add a handler to catch throws from these other functions, so perhaps
this is the source of the extra code. But in this case f() does not
call any other functions, so I don't understand why it has an effect here.