EGCS vs MSVC - exception handling

Jeffrey A Law law@cygnus.com
Wed Jan 14 04:17:00 GMT 1998


  In message < sn090sk7rg3.fsf@zugzwang.mcom.com >you write:
  > > That requires quite a bit more work.  You might start with adding
  > > -fasynchronous-exceptions to the command line (or something close to that
  > )
  > > which instructs flow to create an edge from every insn to its EH handler
  > > (since just about any insn could trap into a signal handler).
  > 
  > Why would that be necessary ? Inside the signal handler, I know
  > precisely which instruction generated the trap by looking into the
  > sigcontext. All I need to do is to be able to unwind the stack and
  > look for the right exception handler to call.
You have to be able to map from any instruction that might throw to its
associated handler.  If you're throwing from a signal handler, then
basically every insn might throw, so each and every insn must have an
edge to its associated handler.

It has nothing to do with unwinding the stack.  It's what you do *after*
the stack is unwound that requires these extra edges.

jeff



More information about the Gcc mailing list