This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [ColdFire 49/63] Save and restore the PIC register when using a constant pool
On Wed, 2007-01-10 at 12:05 +0000, Richard Sandiford wrote:
> Reload can legitimately introduce constant pool references into
> a function that didn't otherwise have them. We're interested
> in three events when this happens:
>
> (a) reload decides to force something into the constant pool
> (b) reload and config/m68k together decide the final frame layout
> (c) reload emits the input and output reload instructions
>
> These events happen in the order listed.
>
> When generating PIC, the PIC form of the address is introduced
> by (c), which in turn sets current_function_uses_pic_offset_table.
> However, we need to know in (b) whether to save the PIC register.
> AIUI, the canonical way of dealing with this is to check
> current_function_uses_const_pool.
>
> Richard
>
>
> gcc/
> * config/m68k/m68k.c (m68k_save_reg): Save the PIC register in
> functions that need a constant pool.
OK. IIRC this fixes the longest standing m68k PIC bug that I was
aware of.
Jeff