This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, arm] Stack the PIC register for Thumb if PIC is enabled
- From: Adam Nemet <anemet at Lnxw dot COM>
- To: Nick Clifton <nickc at redhat dot com>
- Cc: Richard dot Earnshaw at arm dot com, gcc-patches at gcc dot gnu dot org
- Date: 02 Aug 2002 00:39:47 -0700
- Subject: Re: [PATCH, arm] Stack the PIC register for Thumb if PIC is enabled
- References: <200207311232.NAA07048@cam-mail2.cambridge.arm.com><hcvg6v5ald.fsf@anemet1.lynx.com><m3r8hiy6ro.fsf_-_@north-pole.nickc.cambridge.redhat.com>
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