This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Sibcalls and exceptions
- From: Jason Merrill <jason at redhat dot com>
- To: law at redhat dot com
- Cc: Mark Mitchell <mark at codesourcery dot com>, Alexandre Oliva <aoliva at redhat dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 26 Nov 2001 17:06:27 +0000
- Subject: Re: Sibcalls and exceptions
- References: <14280.1006785603@porcupine.cygnus.com>
>>>>> "law" == law <law@redhat.com> writes:
>> IIRC, Richard, Jeff, and I collaborated on this patch. We concluded
>> that the sibling call optimization simply was not exception safe as
>> implemented. Is there anything in the archives about this?
>>
>> I do not think we need to do anything for the branch.
>>
>> The mainline is another story; if we can remove the restriction from
>> my patch, that's great. At the least, Jason's idea is a good one,
>> and a patch to do that is pre-approved.
> If I recall the fundamental issue with sibcalls vs EH is that it is very
> difficult to unwind the frame.
> Most notably the fact that the return address in the frame or in the return
> register points one frame higher than what we want is problematical.
> But what I don't understand is how we're tripping over this in the first
> place -- a call which might throw should have two edges -- one to the
> exception handler, one to the next block. That should have prevented the
> sibcall optimization from applying in the first place.
Indeed. And if there isn't a handler, it doesn't matter if we skip the
frame.
Jason