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.



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



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