This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Saga of m68k PIC continues
>
> While looking at the PIC code, I'm wondering if there is a way to
> suppress setting up the global_table register if:
>
> 1) the funciton is static
> 2) the function's address is not taken
> 3) the function is a leaf.
You can take a look at the i386. 3) can be easilly handled via
current_function_is_leaf.
>
> If so then:
> lea (%pc, _GLOBAL_OFFSET_TABLE_@GOTPC), %a5
>
> doesn't need to be done in the function prologue since all callers to
> the function have already setup %a5. As long as the function doesn't
> modify %a5, everthing should just work...
You can bypass a5 setup by optimizing call to static functions into PC
relative calls, see of SYMBOL_REF_FLAG in i386...
I don't think we handle the scheme with function addresses not taken and
these two tricks are incompatible....
Honza
>
> --
> Peter Barada Peter.Barada@motorola.com
> Wizard 781-852-2768 (direct)
> WaveMark Solutions(wholly owned by Motorola) 781-270-0193 (fax)