diff mbox

[Ada] Generate optimized code for protected subprograms if no exceptions.

Message ID 20140129152212.GA26518@adacore.com
State New
Headers show

Commit Message

Arnaud Charlet Jan. 29, 2014, 3:22 p.m. UTC
If exceptions aren't propagated, the optimized path of
Exp_Ch9.Build_Protected_Subprogram_Body could be used.

No functional change, so no testcase.

Tested on x86_64-pc-linux-gnu, committed on trunk

2014-01-29  Tristan Gingold  <gingold@adacore.com>

	* exp_ch9.adb (Is_Exception_Safe): Return true if no exceptions.
diff mbox

Patch

Index: exp_ch9.adb
===================================================================
--- exp_ch9.adb	(revision 207243)
+++ exp_ch9.adb	(working copy)
@@ -13425,6 +13425,14 @@ 
    --  Start of processing for Is_Exception_Safe
 
    begin
+
+      --  When exceptions can not be propagated, the subprogram will always
+      --  return normaly.
+
+      if No_Exception_Handlers_Set then
+         return True;
+      end if;
+
       --  If the checks handled by the back end are not disabled, we cannot
       --  ensure that no exception will be raised.