ada: Do not perform local-exception-to-goto optimization on barrier functions
commit2578936b341585230d8554bb9c822c3d6f46f6ad
authorPatrick Bernardi <bernardi@adacore.com>
Tue, 15 Aug 2023 19:52:57 +0000 (15 15:52 -0400)
committerMarc Poulhiès <poulhies@adacore.com>
Fri, 15 Sep 2023 13:01:30 +0000 (15 15:01 +0200)
tree0adf9f0824b3f817409497e043f2abcc8c91a07c
parent62e170e586d0822e7b92ca2f92df29d4b7b8e38b
ada: Do not perform local-exception-to-goto optimization on barrier functions

The local-exception-to-goto optimization is no longer applied to entry
barrier functions as entry barriers cannot contain exception handlers and
this optimization interferes with another optimization that occurs for
simple barrier functions.

In particular, the simple barrier optimization removes the push error label
statements generated by the local-exception-to-goto optimization. This
causes a Storage_Error in GIGI when the restriction No_Exception_Propagation
is  active and a protected object contains more than one simple entry
barrier.

gcc/ada/

* exp_ch6.adb (Expand_N_Subprogram_Body): Do not perform
local-exception-to- goto optimization on barrier functions.
* exp_ch9.adb (Expand_Entry_Barrier): Simplify the if statement
around the simple barrier optimization and remove an old, no
longer relevant comment.
gcc/ada/exp_ch6.adb
gcc/ada/exp_ch9.adb