This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Sibcalls and exceptions


>>>>> "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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]