From 3747db827dfedd0f91e08f74b4082da8c0b2df5e Mon Sep 17 00:00:00 2001 From: Ed Schonberg Date: Tue, 29 May 2018 09:42:11 +0000 Subject: [PATCH] [Ada] Unnesting: do not generate push/pop for exceptions 2018-05-29 Ed Schonberg gcc/ada/ * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for exceptions if subprogram unnesting is in effect, because these branch nodes are relevant only in the presence of nested subprograms. From-SVN: r260883 --- gcc/ada/ChangeLog | 6 ++++++ gcc/ada/exp_ch6.adb | 6 +++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9c529da..fecd0f1 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,5 +1,11 @@ 2018-05-29 Ed Schonberg + * exp_ch6.adb (Expand_N_Subprogram_Body): Do not generate push/pop for + exceptions if subprogram unnesting is in effect, because these branch + nodes are relevant only in the presence of nested subprograms. + +2018-05-29 Ed Schonberg + * libgnat/s-fatgen.adb (Succ, Pred): Raise Constraint_Error unconditionally when applied to the largest positive (resp. largest negative) value of a floating-point type. diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb index 7c8ce02..2895ed9 100644 --- a/gcc/ada/exp_ch6.adb +++ b/gcc/ada/exp_ch6.adb @@ -5664,12 +5664,16 @@ package body Exp_Ch6 is -- If local-exception-to-goto optimization active, insert dummy push -- statements at start, and dummy pop statements at end, but inhibit -- this if we have No_Exception_Handlers, since they are useless and - -- intefere with analysis, e.g. by codepeer. + -- interfere with analysis, e.g. by CodePeer. We also don't need these + -- if we're unnesting subprograms because the only purpose of these + -- nodes is to ensure we don't set a label in one subprogram and branch + -- to it in another. if (Debug_Flag_Dot_G or else Restriction_Active (No_Exception_Propagation)) and then not Restriction_Active (No_Exception_Handlers) and then not CodePeer_Mode + and then not Unnest_Subprogram_Mode and then Is_Non_Empty_List (L) then declare -- 2.7.4