Commit 885cf7d3 by Chen Gang Committed by Jeff Law

re PR target/71331 (target-tilegx: nested-function-4.c: r10 is conflict which is…

re PR target/71331 (target-tilegx: nested-function-4.c: r10 is conflict which is both in function frame and in parameter.)

	PR target/71331
	* config/tilegx/tilegx.c (tilegx_function_profiler): Save r10
	to stack before call mcount.
	(tilegx_can_use_return_insn_p): Clean up code.

From-SVN: r242969
parent 57e27acf
2016-11-29 Chen Gang <gang.chen.5i5j@gmail.com>
PR target/71331
* config/tilegx/tilegx.c (tilegx_function_profiler): Save r10
to stack before call mcount.
(tilegx_can_use_return_insn_p): Clean up code.
2016-11-29 Pitchumani Sivanupandi <pitchumani.s@atmel.com> 2016-11-29 Pitchumani Sivanupandi <pitchumani.s@atmel.com>
* config/avr/avr-arch.h (avr_mcu_t): Add flash_size member. * config/avr/avr-arch.h (avr_mcu_t): Add flash_size member.
...@@ -3882,8 +3882,8 @@ bool ...@@ -3882,8 +3882,8 @@ bool
tilegx_can_use_return_insn_p (void) tilegx_can_use_return_insn_p (void)
{ {
return (reload_completed return (reload_completed
&& cfun->static_chain_decl == 0 && !cfun->static_chain_decl
&& compute_total_frame_size () == 0 && !compute_total_frame_size ()
&& tilegx_current_function_is_leaf () && tilegx_current_function_is_leaf ()
&& !crtl->profile && !df_regs_ever_live_p (TILEGX_LINK_REGNUM)); && !crtl->profile && !df_regs_ever_live_p (TILEGX_LINK_REGNUM));
} }
...@@ -5512,6 +5512,15 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) ...@@ -5512,6 +5512,15 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
fprintf (file, "\t}\n"); fprintf (file, "\t}\n");
} }
if (cfun->static_chain_decl)
{
fprintf (file,
"\t{\n"
"\taddi\tsp, sp, -16\n"
"\tst\tsp, r10\n"
"\t}\n");
}
if (flag_pic) if (flag_pic)
{ {
fprintf (file, fprintf (file,
...@@ -5529,6 +5538,13 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) ...@@ -5529,6 +5538,13 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
"\t}\n", MCOUNT_NAME); "\t}\n", MCOUNT_NAME);
} }
if (cfun->static_chain_decl)
{
fprintf (file,
"\taddi\tsp, sp, 16\n"
"\tld\tr10, sp\n");
}
tilegx_in_bundle = false; tilegx_in_bundle = false;
} }
......
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