This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: questions about improving i386 PIC code
- To: john at feith dot com (John Wehle)
- Subject: Re: questions about improving i386 PIC code
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Sun, 07 Jun 1998 01:26:34 -0400
- Cc: egcs at cygnus dot com
>>>>> 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