aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch4.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2013-04-11 14:58:54 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2013-04-11 14:58:54 +0200
commit03eb6036fc6eb40d6e114121920e3093e49dfc18 (patch)
tree1547b16350ca752c1a97751edaddd33a3f57d5ab /gcc/ada/exp_ch4.adb
parente7f11067a1011e49909905be0ea421c4fc8dd1cc (diff)
downloadgcc-03eb6036fc6eb40d6e114121920e3093e49dfc18.zip
gcc-03eb6036fc6eb40d6e114121920e3093e49dfc18.tar.gz
gcc-03eb6036fc6eb40d6e114121920e3093e49dfc18.tar.bz2
[multiple changes]
2013-04-11 Eric Botcazou <ebotcazou@adacore.com> * init.c (RETURN_ADDR_OFFSET): Delete as unused. 2013-04-11 Robert Dewar <dewar@adacore.com> * 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 <moy@adacore.com> * 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 <quinot@adacore.com> * sem_ch13.adb (Same_Representation): Two types with different scalar storage order never have the same representation. 2013-04-11 Arnaud Charlet <charlet@adacore.com> * 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
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r--gcc/ada/exp_ch4.adb26
1 files changed, 18 insertions, 8 deletions
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