aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2016-11-29 18:33:20 +0000
committerJeff Law <law@gcc.gnu.org>2016-11-29 11:33:20 -0700
commit885cf7d356ae115469355016eca2d543b3ebd9c0 (patch)
tree2a464d740e50202ff099d176463216bd71af610a /gcc
parent57e27acf2810cc98f89aa429d2babb6d7673ded9 (diff)
downloadgcc-885cf7d356ae115469355016eca2d543b3ebd9c0.zip
gcc-885cf7d356ae115469355016eca2d543b3ebd9c0.tar.gz
gcc-885cf7d356ae115469355016eca2d543b3ebd9c0.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/tilegx/tilegx.c20
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bd8f1b0..16224c7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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>
* 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 ab12b60..d213552 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;
}