libstdc++: optimize EH phase 2
commit5d9c9119079ef14798b0a4fc771fd8d3905ec746
authorJason Merrill <jason@redhat.com>
Wed, 31 May 2023 19:02:05 +0000 (31 15:02 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 1 Jun 2023 12:49:20 +0000 (1 08:49 -0400)
tree700328c229e0897d620d4d3f9b308568096b96a0
parenteeb92704967875411416b0b9508aa6f49e8192fd
libstdc++: optimize EH phase 2

In the ABI's two-phase EH model, first we walk the stack looking for a
handler, then we walk the stack running cleanups until we reach that
handler.  In the cleanup phase, we shouldn't redundantly check the handlers
along the way, e.g. when walking through g():

  void f() { throw 42; }
  void g() { try { f(); } catch (void *) { } }
  int main() { try { g(); } catch (int) { } }

libstdc++-v3/ChangeLog:

* libsupc++/eh_personality.cc (PERSONALITY_FUNCTION): Don't check
handlers in the cleanup phase.
libstdc++-v3/libsupc++/eh_personality.cc