Patch FUNCTION_PROFILER to avoid code-scheduling botch when compiling

with -mabicalls: the gcc/egcs code emits hand-scheduled code with an
insn in a "jal _mcount" delayslot. But with -mabicalls, the "jal"
expands into a call via $t9 and the delay-slot is already filled.

See PR#5248.
This commit is contained in:
jonathan 1999-02-27 03:36:28 +00:00
parent ff6c8ce557
commit 1192ce7d8f
1 changed files with 2 additions and 1 deletions

View File

@ -2519,13 +2519,14 @@ typedef struct mips_args {
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, "\tjal\t_mcount\n"); \
fprintf (FILE, "\tnop\n"); \
fprintf (FILE, "\t.set\treorder\n"); \
fprintf (FILE, "\t.set\tat\n"); \
}