Commit 61debb78 by David Daney Committed by David Daney

re PR target/37593 (-mlong-calls doesn't affect calls to _mcount generated with -pg)

2008-09-22  David Daney  <ddaney@avtrex.com>

	PR target/37593
	* config/mips/mips.h (FUNCTION_PROFILER): Call _mcount via a
	register if TARGET_LONG_CALLS.

2008-09-22  David Daney  <ddaney@avtrex.com>

	PR target/37593
	* gcc.target/mips/long-calls-pg.c: New test.

From-SVN: r140563
parent ecb4e37b
2008-09-22 David Daney <ddaney@avtrex.com>
PR target/37593
* config/mips/mips.h (FUNCTION_PROFILER): Call _mcount via a
register if TARGET_LONG_CALLS.
2008-09-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37145
......
......@@ -2263,6 +2263,14 @@ typedef struct mips_args {
{ \
if (TARGET_MIPS16) \
sorry ("mips16 function profiling"); \
if (TARGET_LONG_CALLS) \
{ \
/* For TARGET_LONG_CALLS use $3 for the address of _mcount. */ \
if (Pmode == DImode) \
fprintf (FILE, "\tdla\t%s,_mcount\n", reg_names[GP_REG_FIRST + 3]); \
else \
fprintf (FILE, "\tla\t%s,_mcount\n", reg_names[GP_REG_FIRST + 3]); \
} \
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]); \
......@@ -2279,7 +2287,10 @@ typedef struct mips_args {
reg_names[STACK_POINTER_REGNUM], \
Pmode == DImode ? 16 : 8); \
} \
fprintf (FILE, "\tjal\t_mcount\n"); \
if (TARGET_LONG_CALLS) \
fprintf (FILE, "\tjalr\t%s\n", reg_names[GP_REG_FIRST + 3]); \
else \
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) \
......
2008-09-22 David Daney <ddaney@avtrex.com>
PR target/37593
* gcc.target/mips/long-calls-pg.c: New test.
2008-09-22 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37145
......
/* { dg-do compile } */
/* { dg-mips-options "-O2 -mabi=32 -march=mips32 -fno-pic -pg -mno-abicalls -mlong-calls" } */
/* { dg-final { scan-assembler-not "\tjal\t_mcount" } } */
void
foo (void)
{
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment