This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

Re: [arm] Fix -fpic


On Thursday 04 November 2004 12:19, Richard Earnshaw wrote:
> On Wed, 2004-11-03 at 22:28, Paul Brook wrote:
> > The Arm function prologue code only saves/restores the PIC base register
> > when regs_ever_live[PIC_OFFSET_TABLE_REGNUM]. However reloading the pic
> > register is conditional on current_function_uses_pic_offset_table. These
> > can have different values if all PIC references in a function are
> > eliminated.
> >
> > The patch below saves uses current_function_uses_pic_offset_table in both
> > cases. It may be possible to eliminate this variable altogether, and just
> > use live register information. However I don't feel confident enough to
> > make that change in stage3.
> >
> > Tested with cross to arm-none-elf.
> > Applied to mainline and csl-arm-branch.
>
> Is this a consequence of recent changes on these branches, or does the
> change need back-porting to the 3.4 branch?

It is a consequence of recent changes. On 3.4 branch I think the pic register 
loading code if generated before the function prologue, so the live register 
analysis is correct. With recent changes the pic register load is part of the 
function prologue, and is generated after the saved register mask has been 
calculated.

Paul


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