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

Arnaud Charlet charlet@adacore.com
Wed Jan 29 15:22:00 GMT 2014


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.

-------------- next part --------------
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.
 


More information about the Gcc-patches mailing list