* [PATCH v2] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount
@ 2016-06-02 22:23 chengang
2016-06-03 1:21 ` Richard Henderson
0 siblings, 1 reply; 3+ messages in thread
From: chengang @ 2016-06-02 22:23 UTC (permalink / raw)
To: law; +Cc: rth, mikestump, gcc-patches, cmetcalf, walt, peter.maydell, Chen Gang
From: Chen Gang <chengang@emindsoft.com.cn>
r10 may also be as parameter stack pointer for the nested function, so
need save it before call mcount.
2016-06-03 Chen Gang <gang.chen.5i5j@gmail.com>
gcc/
PR target/71331
* config/tilegx/tilegx.c (tilegx_function_profiler): Save r10
to stack before call mcount.
---
gcc/config/tilegx/tilegx.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
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,32 @@ tilegx_function_profiler (FILE *file, int labelno ATTRIBUTE_UNUSED)
if (flag_pic)
{
fprintf (file,
+ "\t{\n"
+ "\taddi\tsp, sp, -8\n"
+ "\tst\tsp, r10\n"
+ "\t}\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,
+ "\t{\n"
+ "\taddi\tsp, sp, -8\n"
+ "\tst\tsp, r10\n"
+ "\t}\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;
--
1.9.3
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount
2016-06-02 22:23 [PATCH v2] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount chengang
@ 2016-06-03 1:21 ` Richard Henderson
2016-06-04 13:04 ` Chen Gang
0 siblings, 1 reply; 3+ messages in thread
From: Richard Henderson @ 2016-06-03 1:21 UTC (permalink / raw)
To: chengang, law; +Cc: mikestump, gcc-patches, cmetcalf, walt, peter.maydell
On 06/02/2016 03:23 PM, chengang@emindsoft.com.cn wrote:
> fprintf (file,
> + "\t{\n"
> + "\taddi\tsp, sp, -8\n"
> + "\tst\tsp, r10\n"
> + "\t}\n"
> "\t{\n"
You need only do this if cfun->static_chain_decl is set.
r~
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount
2016-06-03 1:21 ` Richard Henderson
@ 2016-06-04 13:04 ` Chen Gang
0 siblings, 0 replies; 3+ messages in thread
From: Chen Gang @ 2016-06-04 13:04 UTC (permalink / raw)
To: Richard Henderson, law
Cc: mikestump, gcc-patches, cmetcalf, walt, peter.maydell
On 6/3/16 09:21, Richard Henderson wrote:
> On 06/02/2016 03:23 PM, chengang@emindsoft.com.cn wrote:
>> fprintf (file,
>> + "\t{\n"
>> + "\taddi\tsp, sp, -8\n"
>> + "\tst\tsp, r10\n"
>> + "\t}\n"
>> "\t{\n"
>
> You need only do this if cfun->static_chain_decl is set.
>
OK, thanks, I shall send patch v3 for it, within this week end.
Thanks.
--
Chen Gang (éå)
Managing Natural Environments is the Duty of Human Beings.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-06-04 13:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-02 22:23 [PATCH v2] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount chengang
2016-06-03 1:21 ` Richard Henderson
2016-06-04 13:04 ` Chen Gang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).