This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] gcc/config/tilegx/tilegx.c (tilegx_function_profiler): Save r10 to stack before call mcount


On 5/30/16 21:32, Chen Gang wrote:
> On 5/30/16 03:18, Mike Stump wrote:
>> On May 29, 2016, at 3:39 AM, chengang@emindsoft.com.cn wrote:
>>>
>>> r10 may also be as parameter for the nested function, so need save it
>>> before call mcount.
>>
>> mcount can have a special abi where it preserves more registers than one would otherwise expect.  I'm wondering if you know what registers it saves or doesn't touch?  Does this fix any bug found by running tests, or just by inspection?
>>
> 
> It is about Bug71331, which I reported yesterday.
> 
> For nested function, r10 is treated as the stack pointer for parameters,
> mcount really save r10, but tilegx also use r10 to save lr, so cause
> this issue ("move r10, lr; jal __mcount").
> 
> What I have done just like gcc x86 has done ("push r10; callq mcount").
> 

After this patch, nested-func-4.c can passes compiling and running under
tilegx qemu. :-)

Thanks.
-- 
Chen Gang (éå)

Managing Natural Environments is the Duty of Human Beings.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]