PATCH RFA: Split stack [4/7]: REF_CFA_TEMPORARY

Richard Henderson rth@redhat.com
Fri Sep 24 21:30:00 GMT 2010


On 09/24/2010 10:33 AM, Ian Lance Taylor wrote:
> Actually, I'm going to withdraw this part of the patch.  It was
> necessary at one time to unwind the stack, but now the assembly code
> uses slightly tricky unwind info to skip the single return instruction
> entirely during the unwind process.

Actually -fasynchronous-unwind-tables needs it.

If the interrupt that samples the call-stack happens at
that lone return insn, we'll have wrong unwind info.

> I'm a bit reluctant to do that now, since there seem to be several
> different variants of the x86 call instruction.  It's certainly a
> possibility for later.

There's really no need to consider all the different rtl call
variants.  There's only one actual direct call insn.

Ignoring the unwind info and return stack popping for clarity,
the insn pattern could be as simple as

(define_insn "morestack"
  [(unspec_v [(match_operand 0)] UNSPECV_MORESTACK)]
  ""
  "call __morestack\;ret"
  )

That said, I wonder about the relative impact of the call-stack
branch (mis)prediction vs the double-branch and extra icache fetches.


r~



More information about the Gcc-patches mailing list