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


>>>>> John Wehle writes:

John> What's the feasibility / ramifications of deferring generating
John> the assembler code for static functions until all other functions
John> have been compiled?  This way we can detect if the function is
John> only referenced in calls in which case the pic register doesn't
John> need to be reloaded.

	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.  Normally the linker would need to restore the TOC (GOT)
when making a non-local call.  The port explicitly uses SYMBOL_REF_FLAG
for this purpose, setting it when

    if (TREE_ASM_WRITTEN (decl) || ! TREE_PUBLIC (decl))
        SYMBOL_REF_FLAG (sym_ref) = 1;

Some of the "call" define_insn patterns then have a special predicate
which checks for the flag to avoid emitting the NOP.

David


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