Apply the patch from:

http://gcc.gnu.org/ml/gcc-patches/2000-06/msg00389.html

ChangeLog for this change (which was never committed to the master
GCC sources; the bug still exists in GCC 3.x!):

2000-05-09  Ethan Solomita  ethan@cs.columbia.edu

	* config/mips/mips.h (FUNCTION_PROFILER): Deal with
	the case where jal is expanded as a macro.

This is done by removing the .reorder/.noreorder, and moving the
call to _mcount to after the stack adjust, thereby letting the
assembler deal with the delay slot, etc.

This fixes profiling with libraries built -mabicalls (default on
NetBSD).

I can't believe how long this problem has been discussed-but-not-fixed
on the GCC mailing list...
This commit is contained in:
thorpej 2002-01-04 05:29:39 +00:00
parent 4700ae8e79
commit 6c4e00eadf
1 changed files with 1 additions and 3 deletions

View File

@ -2606,18 +2606,16 @@ typedef struct mips_args {
{ \
if (TARGET_MIPS16) \
sorry ("mips16 function profiling"); \
fprintf (FILE, "\t.set\tnoreorder\n"); \
fprintf (FILE, "\t.set\tnoat\n"); \
fprintf (FILE, "\tmove\t%s,%s\t\t# save current return address\n", \
reg_names[GP_REG_FIRST + 1], reg_names[GP_REG_FIRST + 31]); \
fprintf (FILE, "\tjal\t_mcount\n"); \
fprintf (FILE, \
"\t%s\t%s,%s,%d\t\t# _mcount pops 2 words from stack\n", \
TARGET_64BIT ? "dsubu" : "subu", \
reg_names[STACK_POINTER_REGNUM], \
reg_names[STACK_POINTER_REGNUM], \
Pmode == DImode ? 16 : 8); \
fprintf (FILE, "\t.set\treorder\n"); \
fprintf (FILE, "\tjal\t_mcount\n"); \
fprintf (FILE, "\t.set\tat\n"); \
}