mips.c (mips_output_mi_thunk): Only load gp if not LOADGP_ABSOLUTE and not binds_local_p.

* config/mips/mips.c (mips_output_mi_thunk): Only load gp if not
	LOADGP_ABSOLUTE and not binds_local_p.

From-SVN: r125276
This commit is contained in:
David Daney 2007-06-02 04:27:40 +00:00 committed by David Daney
parent 45d5f86c41
commit adb04511e3
2 changed files with 11 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2007-06-01 David Daney <ddaney@avtrex.com>
* config/mips/mips.c (mips_output_mi_thunk): Only load gp if not
LOADGP_ABSOLUTE and not binds_local_p.
2007-06-01 Geoffrey Keating <geoffk@apple.com>
* config/darwin.h (LINK_SPEC): Pass -fpie through to the linker.

View File

@ -7335,8 +7335,12 @@ mips_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
= REGNO (pic_offset_table_rtx)
= TARGET_CALL_SAVED_GP ? 15 : GLOBAL_POINTER_REGNUM;
/* Set up the global pointer for n32 or n64 abicalls. */
mips_emit_loadgp ();
/* Set up the global pointer for n32 or n64 abicalls. If
LOADGP_ABSOLUTE then the thunk does not use the gp and there is
no need to load it.*/
if (mips_current_loadgp_style () != LOADGP_ABSOLUTE
|| !targetm.binds_local_p (function))
mips_emit_loadgp ();
/* We need two temporary registers in some cases. */
temp1 = gen_rtx_REG (Pmode, 2);