[PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro
Moore, Catherine
Catherine_Moore@mentor.com
Fri Feb 6 15:12:00 GMT 2015
> -----Original Message-----
> From: Matthew Fortune [mailto:Matthew.Fortune@imgtec.com]
> Sent: Thursday, February 05, 2015 3:52 PM
> Subject: RE: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro
> >
> I've put your patch inline below and switched to plain text. I suspect your
> post was bounced by gcc-patches.
>
> I'm OK with this change but I'd like Catherine to comment before committing.
> It seems a shame to duplicate the block of code but it is probably just as ugly
> to define a macro for the la/dla instruction.
The patch itself is OK, although I agree with other's comments about the unfortunate duplication of code.
Petar, would you please add your testcase to the gcc testsuite and repost the patch.
Thanks,
Catherine
>
> For future reference, it is best not to include changelog content in a patch
> but instead just paste into the email. Also the ChangeLog you need for this
> change is gcc/ChangeLog (as confusing as that may be at first).
>
> Thanks,
> Matthew
>
> > From: Petar Jovanovic [mailto:petar.jovanovic@rt-rk.com]
> > Sent: 05 February 2015 19:28
> > To: gcc-patches@gcc.gnu.org; 'Maciej W. Rozycki'; Matthew Fortune
> > Subject: [PATCH v2][MIPS] fix CRT_CALL_STATIC_FUNCTION macro
> >
> > v2:
> > - add ChangeLog entry
> > - use DLA instead of LA for n64
> >
> > PTAL. Thanks.
> >
> > Regards,
> > Petar
>
> ---
> ChangeLog | 5 +++++
> gcc/config/mips/mips.h | 23 +++++++++++++++++++----
> 2 files changed, 24 insertions(+), 4 deletions(-)
>
> diff --git a/ChangeLog b/ChangeLog
> index 5c61c66..3a15f4a 100644
> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -1,3 +1,8 @@
> +2015-02-05 Petar Jovanovic <petar.jovanovic@rt-rk.com>
> +
> + * config/mips/mips.h (CRT_CALL_STATIC_FUNCTION): Fix the macro
> to use
> + la/jalr instead of jal.
> +
> 2015-02-02 Janis Johnson <janis.marie.johnson@gmail.com>
>
> * MAINTAINERS (Various Maintainers: testsuite): Remove myself.
> diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h index
> ec69ed5..4bd83f5 100644
> --- a/gcc/config/mips/mips.h
> +++ b/gcc/config/mips/mips.h
> @@ -3034,11 +3034,11 @@ while (0)
> nop\n\
> 1: .cpload $31\n\
> .set reorder\n\
> - jal " USER_LABEL_PREFIX #FUNC "\n\
> + la $25, " USER_LABEL_PREFIX #FUNC "\n\
> + jalr $25\n\
> .set pop\n\
> " TEXT_SECTION_ASM_OP);
> -#elif ((defined _ABIN32 && _MIPS_SIM == _ABIN32) \
> - || (defined _ABI64 && _MIPS_SIM == _ABI64))
> +#elif (defined _ABIN32 && _MIPS_SIM == _ABIN32)
> #define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
> asm (SECTION_OP "\n\
> .set push\n\
> @@ -3048,7 +3048,22 @@ while (0)
> nop\n\
> 1: .set reorder\n\
> .cpsetup $31, $2, 1b\n\
> - jal " USER_LABEL_PREFIX #FUNC "\n\
> + la $25, " USER_LABEL_PREFIX #FUNC "\n\
> + jalr $25\n\
> + .set pop\n\
> + " TEXT_SECTION_ASM_OP);
> +#elif (defined _ABI64 && _MIPS_SIM == _ABI64)
> +#define CRT_CALL_STATIC_FUNCTION(SECTION_OP, FUNC) \
> + asm (SECTION_OP "\n\
> + .set push\n\
> + .set nomips16\n\
> + .set noreorder\n\
> + bal 1f\n\
> + nop\n\
> +1: .set reorder\n\
> + .cpsetup $31, $2, 1b\n\
> + dla $25, " USER_LABEL_PREFIX #FUNC "\n\
> + jalr $25\n\
> .set pop\n\
> " TEXT_SECTION_ASM_OP);
> #endif
> --
> 1.8.2.1
More information about the Gcc-patches
mailing list