Inefficient code generation with -fPIC.

Joe Buck jbuck@localhost.localdomain
Mon Nov 13 09:36:00 GMT 2000


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




More information about the Gcc mailing list