Zero overhead exception handling in C++

Mike Stump mrs@apple.com
Mon Nov 4 14:55:00 GMT 2002


What platform did you se it on?  Which instructions did you see?  What 
was the testcase?

On Monday, November 4, 2002, at 02:31 PM, Bo-Staffan Lankinen wrote:
> I was under the impression that g++3.x had zero overhead exception 
> handling.
> However, that doesn't seem to be the case, because there are 
> instructions
> belonging to EH in both the prolog and epilog of the functions. Do you 
> plan
> on including zero overhead EH in a future version of g++?

When I tried it, I notice an extra jmp (known issue) and lack of 
sibcall and some extra instructions relating to frame management, 
that's about it:

void bar();

void foo() {
   try {
     bar();
   } catch (...) { }
}

Did you mean more than these instructions?

We know that EH does slightly degrade the code some, but its expense is 
much less than the setjmp/longjmp scheme.



More information about the Gcc mailing list