summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-02 04:27:40 +0000
committerdaney <daney@138bc75d-0d04-0410-961f-82ee72b054a4>2007-06-02 04:27:40 +0000
commit790a389c121f055856edf51194e0821f789f6818 (patch)
tree1f5af0bdd412240edf4f951e9256a810d731b589
parentf90c9f0e663601de8b118cf6a26624a9bcf92a8a (diff)
downloadgcc-790a389c121f055856edf51194e0821f789f6818.tar.gz
* config/mips/mips.c (mips_output_mi_thunk): Only load gp if not
LOADGP_ABSOLUTE and not binds_local_p. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@125276 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/mips/mips.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ba77c9926d1..904fe7d7a34 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index ddab40c1ffe..0e860b6d3cc 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -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);