[Ada] Limited function violates No_Exception_Propagation
authorHristian Kirtchev <kirtchev@adacore.com>
Wed, 14 Nov 2018 11:40:47 +0000 (11:40 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Wed, 14 Nov 2018 11:40:47 +0000 (11:40 +0000)
commit640ad9c221fe9bac7bff0d60a8aa094f09538bec
treed64b95ae560994460487838cc2f5bf1180dc6eb3
parente1a20c09aac4149f3099cfc313bbfcd6672064bc
[Ada] Limited function violates No_Exception_Propagation

This patch suppresses the generation of raise statements in the context
of build-in-place and elaboration checks for primitives of tagged types
when exceptions cannot be used.

2018-11-14  Hristian Kirtchev  <kirtchev@adacore.com>

gcc/ada/

* checks.adb (Install_Primitive_Elaboration_Check): Do not
create the check when exceptions cannot be used.
* exp_ch6.adb (Expand_N_Extended_Return_Statement): Do not raise
Program_Errror when exceptions cannot be used. Analyze the
generated code with all checks suppressed.
* exp_ch7.adb (Build_Finalizer): Remove the declaration of
Exceptions_OK.
(Make_Deep_Array_Body): Remove the declaration of Exceptions_OK.
(Make_Deep_Record_Body): Remove the declaration of
Exceptions_OK.
(Process_Transients_In_Scope): Remove the declaration of
Exceptions_OK.
* exp_util.adb (Exceptions_In_Finalization_OK): Renamed to
Exceptions_OK.
* exp_util.ads (Exceptions_In_Finalization_OK): Renamed to
Exceptions_OK.

gcc/testsuite/

* gnat.dg/bip_exception.adb, gnat.dg/bip_exception.ads,
gnat.dg/bip_exception_pkg.ads: New testcase.

From-SVN: r266115
gcc/ada/ChangeLog
gcc/ada/checks.adb
gcc/ada/exp_ch6.adb
gcc/ada/exp_ch7.adb
gcc/ada/exp_util.adb
gcc/ada/exp_util.ads
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/bip_exception.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/bip_exception.ads [new file with mode: 0644]
gcc/testsuite/gnat.dg/bip_exception_pkg.ads [new file with mode: 0644]