From: Chen Gang Date: Tue, 29 Nov 2016 18:33:20 +0000 (+0000) Subject: re PR target/71331 (target-tilegx: nested-function-4.c: r10 is conflict which is... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=885cf7d356ae115469355016eca2d543b3ebd9c0;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bd8f1b0c7c8..16224c78659 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2016-11-29 Chen Gang + + 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 * config/avr/avr-arch.h (avr_mcu_t): Add flash_size member. diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c index ab12b60567d..d2135520a00 100644 --- a/gcc/config/tilegx/tilegx.c +++ b/gcc/config/tilegx/tilegx.c @@ -3882,8 +3882,8 @@ bool tilegx_can_use_return_insn_p (void) { return (reload_completed - && cfun->static_chain_decl == 0 - && compute_total_frame_size () == 0 + && !cfun->static_chain_decl + && !compute_total_frame_size () && tilegx_current_function_is_leaf () && !crtl->profile && !df_regs_ever_live_p (TILEGX_LINK_REGNUM)); } @@ -5512,6 +5512,15 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) 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) { fprintf (file, @@ -5529,6 +5538,13 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED) "\t}\n", MCOUNT_NAME); } + if (cfun->static_chain_decl) + { + fprintf (file, + "\taddi\tsp, sp, 16\n" + "\tld\tr10, sp\n"); + } + tilegx_in_bundle = false; }