This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/71331] target-tilegx: nested-function-4.c: r10 is conflict which is both in function frame and in parameter.
- From: "gang.chen.5i5j at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 29 May 2016 10:21:09 +0000
- Subject: [Bug target/71331] target-tilegx: nested-function-4.c: r10 is conflict which is both in function frame and in parameter.
- Auto-submitted: auto-generated
- References: <bug-71331-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71331
--- Comment #1 from Chen Gang <gang.chen.5i5j at gmail dot com> ---
Oh, lucky enough! The diff below should be OK for this issue.
diff --git a/gcc/config/tilegx/tilegx.c b/gcc/config/tilegx/tilegx.c
index 06c832c..bc41105 100644
--- a/gcc/config/tilegx/tilegx.c
+++ b/gcc/config/tilegx/tilegx.c
@@ -5510,18 +5510,28 @@ tilegx_function_profiler (FILE *file, int labelno
ATTRIBUTE_UNUSED)
if (flag_pic)
{
fprintf (file,
+ "\tst\tsp, r10\n"
+ "\taddi\tsp, sp, -8\n"
"\t{\n"
"\tmove\tr10, lr\n"
"\tjal\tplt(%s)\n"
- "\t}\n", MCOUNT_NAME);
+ "\t}\n"
+ "\taddi\tsp, sp, 8\n"
+ "\tld\tr10, sp\n",
+ MCOUNT_NAME);
}
else
{
fprintf (file,
+ "\tst\tsp, r10\n"
+ "\taddi\tsp, sp, -8\n"
"\t{\n"
"\tmove\tr10, lr\n"
"\tjal\t%s\n"
- "\t}\n", MCOUNT_NAME);
+ "\t}\n"
+ "\taddi\tsp, sp, 8\n"
+ "\tld\tr10, sp\n",
+ MCOUNT_NAME);
}
tilegx_in_bundle = false;