summaryrefslogtreecommitdiff
path: root/gcc/config/mips/sdemtk.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-09 18:11:19 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-08-09 18:11:19 +0000
commitd0d816ec5bd9c458f1ff735aa15b9998c369b6c1 (patch)
tree38db689918460ec7f1bb4f5cf2cee25d2b6952b4 /gcc/config/mips/sdemtk.h
parenta8cceccd90827cb0920c0af1ed823e37d8d72e2a (diff)
downloadgcc-d0d816ec5bd9c458f1ff735aa15b9998c369b6c1.tar.gz
gcc/
* config/mips/mips.h (STATIC_CHAIN_REGNUM): Remap to $15. (FUNCTION_PROFILER): Save the static chain pointer into $2 beforehand and restore it aftewards. (TRAMPOLINE_TEMPLATE): Adjust accordingly. Load the target address directly into $25 and call the function through $25; do not clobber $3. Pad the DImode version to cover the space left by the deleted $25 <- $3 move. (TRAMPOLINE_SIZE): Adjust the size of the SImode version after the removal of the $25 <- $3 move. (INITIALIZE_TRAMPOLINE): Update offsets accordingly. * config/mips/sdemtk.h (FUNCTION_PROFILER): As for mips.h. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@138909 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/mips/sdemtk.h')
-rw-r--r--gcc/config/mips/sdemtk.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/config/mips/sdemtk.h b/gcc/config/mips/sdemtk.h
index a73e7d2d7b3..f6b60970727 100644
--- a/gcc/config/mips/sdemtk.h
+++ b/gcc/config/mips/sdemtk.h
@@ -94,12 +94,20 @@ extern void mips_sync_icache (void *beg, unsigned long len);
#define FUNCTION_PROFILER(FILE, LABELNO) \
{ \
fprintf (FILE, "\t.set\tnoat\n"); \
+ /* _mcount treats $2 as the static chain register. */ \
+ if (cfun->static_chain_decl != NULL) \
+ fprintf (FILE, "\tmove\t%s,%s\n", reg_names[2], \
+ reg_names[STATIC_CHAIN_REGNUM]); \
/* MIPS16 code passes saved $ra in $v1 instead of $at. */ \
fprintf (FILE, "\tmove\t%s,%s\n", \
reg_names[GP_REG_FIRST + (TARGET_MIPS16 ? 3 : 1)], \
reg_names[GP_REG_FIRST + 31]); \
fprintf (FILE, "\tjal\t_mcount\n"); \
fprintf (FILE, "\t.set\tat\n"); \
+ /* _mcount treats $2 as the static chain register. */ \
+ if (cfun->static_chain_decl != NULL) \
+ fprintf (FILE, "\tmove\t%s,%s\n", reg_names[STATIC_CHAIN_REGNUM], \
+ reg_names[2]); \
}
/* ...nor does the call sequence preserve $31. */