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: [PATCH, arm] Stack the PIC register for Thumb if PIC is enabled


Nick,

Thanks for looking into this patch.

> I think that this patch would be better if you moved the entire test
> for a thumb register being pushed into a macro and then just used the
> macro throughtout arm.[ch].  See the attached reworked patch for an
> example.
> 
> Using a macro has several advantages:
> 
>   * It will be easier to update the test in the future.
> 
>   * It eliminates discrepancies in different functions which need to
>     decide if a register will be stacked.  For example the current
>     implementation of THUMB_INITIAL_ELIMINATION_OFFSET does not take
>     into account "!(TARGET_SINGLE_PIC_BASE && ((reg) == arm_pic_register))"
> 
>   * It reduces source code size and makes the code easier to read.
> 
> What do you think ?

I agree.  I just simply followed the logic (and the lack of
abstraction) that was used with ARM.  For completeness we should
probably add ARM_REG_PUSHED_P later as well.

If you want I can update the ChangeLog and rerun the tests
(-marm/-mthumb with /-fPIC/-fPIC -mpic-register=6).  Let me know.

Adam


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