This is the mail archive of the
mailing list for the GCC project.
Re: Question about DRAP register and reserving hard registers
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: sellcey at imgtec dot com
- Cc: Richard Henderson <rth at redhat dot com>, GCC Development <gcc at gcc dot gnu dot org>
- Date: Thu, 9 Jul 2015 09:49:54 -0700
- Subject: Re: Question about DRAP register and reserving hard registers
- Authentication-results: sourceware.org; auth=none
- References: <163e6dcd-b157-47a1-aed3-01eb1b287851 at BAMAIL02 dot ba dot imgtec dot org> <5584148A dot 7040602 at redhat dot com> <1435011263 dot 3099 dot 65 dot camel at ubuntu-sellcey> <55911981 dot 2070901 at redhat dot com> <1436459498 dot 19674 dot 56 dot camel at ubuntu-sellcey>
On Thu, Jul 9, 2015 at 9:31 AM, Steve Ellcey <email@example.com> wrote:
> On Mon, 2015-06-29 at 11:10 +0100, Richard Henderson wrote:
>> > OK, I think I have this part of the code working on MIPS but
>> > crtl->drap_reg is used in the epilogue as well as the prologue even if
>> > it is not 'live' in between. If I understand the code correctly the x86
>> > prologue pushes the drap register on to the stack so that the epilogue
>> > can pop it off and use it to restore the stack pointer. Is my
>> > understanding correct?
>> Yes. Although that saved copy is also used by unwind info.
> Do you know how and where this saved copy is used by the unwind info?
> I don't see any indication that the unwind library knows if a stack has
> been dynamically realigned and I don't see where unwind makes use of
> this value.
This is a very old patch for DRAP unwind with stack alignment:
You can also grep drap_reg in dwarf2out.c.