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: questions about improving i386 PIC code



> 	If I understand this case, I think that the rs6000 port does
> something similar for AIX where it avoids emitting a NOP after a local
> function call.

In the IBM calling convention the caller sets the GOT register (via a
linker provided "glue" function) and restores it after the call.  In most
other PIC code the called function sets its own GOT.  gcc knows when a
direct call is to a static function.  gcc does not know when a function is
only called from the local file.

Some compilers do intra-module call optimizations, based on analysis of
the entire source file (a long standing deficiency of gcc).  The latest
MIPS compilers have #pragma directives for such optimizations.  For
example, one can assert that a function is only called from the same
module (i.e. from a function using the same GOT).  This is useful when a
function is used in more than one file within a shared library but is not
exported by the library.



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