This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libitm: Add custom HTM fast path for RTM on x86_64.
- From: Richard Henderson <rth at redhat dot com>
- To: Torvald Riegel <triegel at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>, Andreas Krebbel <krebbel at linux dot vnet dot ibm dot com>, Peter Bergner <bergner at vnet dot ibm dot com>, "Kleen, Andi" <andi dot kleen at intel dot com>
- Date: Thu, 22 Aug 2013 12:05:16 -0700
- Subject: Re: [PATCH] libitm: Add custom HTM fast path for RTM on x86_64.
- References: <1377094606 dot 3196 dot 4901 dot camel at triegel dot csb> <5214FDEB dot 5040306 at redhat dot com> <1377196773 dot 3196 dot 5959 dot camel at triegel dot csb>
On 08/22/2013 11:39 AM, Torvald Riegel wrote:
> + /* Store edi for future HTM fast path retries. We use a stack slot
> + lower than the jmpbuf so that the jmpbuf's rip field will overlap
> + with the proper return address on the stack. */
> + movl %edi, -64(%rsp)
You havn't allocated the stack frame here, and you're storing
outside the redzone. This is invalid.
Two possibilities:
(1) always allocate the stack frame on entry to
the function (adds two register additions to
the htm fast path -- in the noise i'd think)
(2) store the edi value in the non-htm path, with
the pr_HTMRetryableAbort bit or'd in. (adds an
extra store to the non-htm path; probably noise).
You'd want to mask out that bit when you reload it.
r~