From 03eb6036fc6eb40d6e114121920e3093e49dfc18 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Thu, 11 Apr 2013 14:58:54 +0200 Subject: [multiple changes] 2013-04-11 Eric Botcazou * init.c (RETURN_ADDR_OFFSET): Delete as unused. 2013-04-11 Robert Dewar * a-crbtgk.adb, a-ciorse.adb, a-crbtgo.adb, a-coorse.adb, a-rbtgbo.adb, a-cborse.adb, a-rbtgso.adb, exp_ch3.adb: Minor reformatting. 2013-04-11 Yannick Moy * exp_ch4.adb (Expand_N_Selected_Component): Do not expand discriminant check for Unchecked_Union. * sem_res.adb (Resolve_Selected_Component): Set flag Do_Discriminant_Check even when expansion is not performed. * sinfo.ads (Do_Discriminant_Check): Update documentation for the case of Unchecked_Union. 2013-04-11 Thomas Quinot * sem_ch13.adb (Same_Representation): Two types with different scalar storage order never have the same representation. 2013-04-11 Arnaud Charlet * xgnatugn.adb (Push_Conditional): Simplify handling, no longer need to keep track of "excluding" sections. (Currently_Excluding): Removed. (Process_Source_File): Set unw/vms flag so that texinfo can do the whole handling of @ifset/@ifclear sections. Fix handling of nested @ifset/@ifclear sections. * gnat_ugn.texi: Add a section on performing unassisted install on Windows. From-SVN: r197785 --- gcc/ada/exp_ch4.adb | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) (limited to 'gcc/ada/exp_ch4.adb') diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index be5d17f..3a70183 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -9198,6 +9198,7 @@ package body Exp_Ch4 is Loc : constant Source_Ptr := Sloc (N); Par : constant Node_Id := Parent (N); P : constant Node_Id := Prefix (N); + S : constant Node_Id := Selector_Name (N); Ptyp : Entity_Id := Underlying_Type (Etype (P)); Disc : Entity_Id; New_N : Node_Id; @@ -9273,18 +9274,27 @@ package body Exp_Ch4 is -- Deal with discriminant check required if Do_Discriminant_Check (N) then + if Present (Discriminant_Checking_Func + (Original_Record_Component (Entity (S)))) + then + -- Present the discriminant checking function to the backend, so + -- that it can inline the call to the function. + + Add_Inlined_Body + (Discriminant_Checking_Func + (Original_Record_Component (Entity (S)))); - -- Present the discriminant checking function to the backend, so that - -- it can inline the call to the function. + -- Now reset the flag and generate the call - Add_Inlined_Body - (Discriminant_Checking_Func - (Original_Record_Component (Entity (Selector_Name (N))))); + Set_Do_Discriminant_Check (N, False); + Generate_Discriminant_Check (N); - -- Now reset the flag and generate the call + -- In the case of Unchecked_Union, no discriminant checking is + -- actually performed. - Set_Do_Discriminant_Check (N, False); - Generate_Discriminant_Check (N); + else + Set_Do_Discriminant_Check (N, False); + end if; end if; -- Ada 2005 (AI-318-02): If the prefix is a call to a build-in-place -- cgit v1.1