allow EH to escape from GIMPLE_EH_ELSE ELSE block
authorAlexandre Oliva <oliva@adacore.com>
Fri, 12 Jul 2019 13:51:00 +0000 (13:51 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Fri, 12 Jul 2019 13:51:00 +0000 (13:51 +0000)
commitb847405adee3059762816ab009bc4a5281b5b911
tree3ae3db7d3fe556b1cb3773608d0c11f4e9fccf48
parentfdc1f34302906036637445455a53a09f25a4acfd
allow EH to escape from GIMPLE_EH_ELSE ELSE block

The only preexisting use of GIMPLE_EH_ELSE, for transactional memory
commits, did not allow exceptions to escape from the ELSE path.  The
trick it uses to allow the ELSE path to see the propagating exception
does not work very well if the exception cleanup raises further
exceptions: the ELSE block is configured to handle exceptions in
itself.  This confuses the heck out of CFG and EH cleanups.

Basing the lowering context for the ELSE block on outer_state, rather
than this_state, gets us the expected enclosing handler.

for  gcc/ChangeLog

* tree-eh.c (honor_protect_cleanup_actions): Use outer_
rather than this_state as the lowering context for the ELSE
seq in a GIMPLE_EH_ELSE.

for  gcc/testsuite/ChangeLog

* gcc.dg/gimplefe-44.c: New.

From-SVN: r273444
gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/gimplefe-44.c [new file with mode: 0644]
gcc/tree-eh.c