diff options
author | Robert Dewar <dewar@adacore.com> | 2011-08-01 10:39:44 +0000 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2011-08-01 12:39:44 +0200 |
commit | bd949ee2a3d34419fd1ec4389a7c02174b21ed1d (patch) | |
tree | 49aaa8dd4a3df803441316b3df4c9b9c806e68a2 /gcc/ada/exp_ch4.adb | |
parent | f1c952af5e5c09676e9e26a88b78c7138e60d3f4 (diff) | |
download | gcc-bd949ee2a3d34419fd1ec4389a7c02174b21ed1d.zip gcc-bd949ee2a3d34419fd1ec4389a7c02174b21ed1d.tar.gz gcc-bd949ee2a3d34419fd1ec4389a7c02174b21ed1d.tar.bz2 |
freeze.adb (Freeze_Entity): Don't call Check_Aspect_At_Freeze_Point here.
2011-08-01 Robert Dewar <dewar@adacore.com>
* freeze.adb (Freeze_Entity): Don't call Check_Aspect_At_Freeze_Point
here.
(Freeze_All_Ent): Fix error in handling inherited aspects.
* sem_ch13.adb (Analyze_Aspect_Specifications): Skip aspect that is
already analyzed, but don't skip entire processing of a declaration,
that's wrong in some cases of declarations being rewritten.
(Analyze_Aspect_Specification): Set Is_Delayed_Aspect in aspects.
Don't delay for integer, string literals
Treat predicates in usual manner for delay, remove special case code,
not needed.
(Analyze_Freeze_Entity): Make call to Check_Aspect_At_Freeze_Point
(Build_Predicate_Function): Update saved expression in aspect
(Build_Invariant_Procedure): Update saved expression in aspect
* exp_ch4.adb (Expand_N_Selected_Component): Only do the optimization
of replacement of discriminant references if the reference is simple.
From-SVN: r177010
Diffstat (limited to 'gcc/ada/exp_ch4.adb')
-rw-r--r-- | gcc/ada/exp_ch4.adb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb index fa1ad4f..480422b 100644 --- a/gcc/ada/exp_ch4.adb +++ b/gcc/ada/exp_ch4.adb @@ -7688,10 +7688,17 @@ package body Exp_Ch4 is Discr_Loop : while Present (Dcon) loop Dval := Node (Dcon); - -- Check if this is the matching discriminant - - if Disc = Entity (Selector_Name (N)) then - + -- Check if this is the matching discriminant and if the + -- discriminant value is simple enough to make sense to + -- copy. We don't want to copy complex expressions, and + -- indeed to do so can cause trouble (before we put in + -- this guard, a discriminant expression containing an + -- AND THEN was copied, cause coverage problems + + if Disc = Entity (Selector_Name (N)) + and then (Is_Entity_Name (Dval) + or else Is_Static_Expression (Dval)) + then -- Here we have the matching discriminant. Check for -- the case of a discriminant of a component that is -- constrained by an outer discriminant, which cannot |