From: Cary Coutant <cary@cup.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] Unwind problem for __attribute__ noreturn
Date: Wed, 21 Mar 2001 18:48:54 +0000 [thread overview]
Message-ID: <marc-linux-ia64-105590693005318@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590693005303@msgid-missing>
>Anyhow, I'll re-read the unwind conventions when I'm back at work.
>Either the document answers this question unambigiously and one of the
>existing unwinder implementation is wrong, or it doesn't answer the
>question, in which case we need to pick one solution and work towards
>clarifying this point in the manual.
I'll admit up front that the unwind conventions do not answer this
question explictly, and they should.
The unwind conventions, however, are built on the assumption that the
return pointer can always be used to determine the unwind state of the
caller, whether that return pointer was generated by a br.call
instruction, or through some equivalent assembly code.
Anyone using an assembly coding trick to make the return go somewhere
other than immediately after the call must bear the responsibility of
ensuring that the unwind information is correct.
In the case of a call to a "noreturn" procedure, I'll offer the opinion
that having the unwinder decrement the rp is not correct. Two solutions
immediately come to mind:
1. Emit a bundle of nops following the call. I understand that this is at
odds with the goal of being able to describe fully-optimized code, but it
seems like a rare enough case and a small enough penalty that we could
live with it.
2. Turn the call into a tail call. Thus, in a call chain A calls B calls
C, where C is the noreturn procedure, B would instead branch to C, making
it look like A called C. You have to deallocate B's memory stack frame,
so the bundle of nops may actually be more attractive unless B doesn't
actually have a memory stack frame -- but it's also possible that the
deallocation could be accomplished in spare instruction slots. C would
simply take over B's register stack frame. As noted in the runtime
document, tail calls can be done only when all arguments are in registers.
-cary
next prev parent reply other threads:[~2001-03-21 18:48 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-20 2:10 [Linux-ia64] Unwind problem for __attribute__ noreturn Keith Owens
2001-03-21 0:24 ` Jim Wilson
2001-03-21 6:03 ` Keith Owens
2001-03-21 6:53 ` David Mosberger
2001-03-21 7:12 ` Jim Wilson
2001-03-21 7:54 ` David Mosberger
2001-03-21 8:54 ` Keith Owens
2001-03-21 17:54 ` David Mosberger
2001-03-21 18:48 ` Cary Coutant [this message]
2001-03-21 19:07 ` Jim Wilson
2001-03-21 19:13 ` David Mosberger
2001-03-21 19:13 ` Jim Wilson
2001-03-21 19:26 ` Cary Coutant
2001-03-21 19:40 ` Jim Wilson
2001-03-21 19:58 ` David Mosberger
2001-03-21 20:00 ` Jim Wilson
2001-03-21 20:38 ` Jim Wilson
2001-03-21 22:54 ` David Mosberger
2001-03-21 23:42 ` Cary Coutant
2001-03-22 17:00 ` Rich Altmaier
2001-03-23 20:28 ` Jim Wilson
2001-03-24 0:58 ` Cary Coutant
2001-03-24 1:27 ` Keith Owens
2001-03-24 1:37 ` Jim Wilson
2001-03-26 22:06 ` DE-DINECHIN,CHRISTOPHE (HP-Cupertino,ex1)
2001-03-26 22:58 ` Cary Coutant
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=marc-linux-ia64-105590693005318@msgid-missing \
--to=cary@cup.hp.com \
--cc=linux-ia64@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox