diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-04-04 20:51:50 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-04-04 20:51:50 +0200 |
commit | 77e0c0df0907657a7d72bbba9e6329d93ec65edb (patch) | |
tree | 52356701c78b3d4fb4f30298651fd5744e75a2aa /libstdc++-v3/include/std/stdexcept | |
parent | 8f1f35f1cb1c31e2822e241e56e0a04927e1b78a (diff) | |
download | gcc-77e0c0df0907657a7d72bbba9e6329d93ec65edb.zip gcc-77e0c0df0907657a7d72bbba9e6329d93ec65edb.tar.gz gcc-77e0c0df0907657a7d72bbba9e6329d93ec65edb.tar.bz2 |
cfgrtl: Remove REG_EH_REGION notes from tail calls [PR119613]
In PR119491 r15-9154 I've allowed some useless EH regions for musttail
calls (if there are no non-debug/clobber stmts before resx which resumes
external throwing).
Now, for -O1+ (but not -O0/-Og) there is a cleanup_eh pass after it
which should optimize that way.
The following testcase ICEs at -O0 though, the cleanup_eh in that case
is before the musttail pass and dunno why it didn't actually optimize
it away.
The following patch catches that during expansion and just removes the note,
which causes EH cleanups to do the rest. A tail call, even when it throws,
will not throw while the musttail caller's frame is still on the stack,
will throw after that and so REG_EH_REGION for it is irrelevant (like it
would be never set before the r15-9154 changes).
2025-04-04 Jakub Jelinek <jakub@redhat.com>
PR middle-end/119613
* cfgrtl.cc (purge_dead_edges): Remove REG_EH_REGION notes from
tail calls.
* g++.dg/opt/pr119613.C: New test.
Diffstat (limited to 'libstdc++-v3/include/std/stdexcept')
0 files changed, 0 insertions, 0 deletions