summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_attr.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-27 13:33:32 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-27 13:33:32 +0000
commit58f8748b2c3d7c396a060cdcb14f61bafb65e7e9 (patch)
treefe6c587e28a3fcdecb46c4b241da6e3566945286 /gcc/ada/exp_attr.adb
parent9242704384a226a98df71418028e5bc32dbf0bee (diff)
downloadgcc-58f8748b2c3d7c396a060cdcb14f61bafb65e7e9.tar.gz
2009-07-27 Ed Schonberg <schonberg@adacore.com>
* exp_attr.adb (Expand_Attribute_Reference, case 'Valid): Reset the Is_Known_Valid flag on the temporary created for the value whose validity is being checked. * sem.adb (Do_Unit_And_Dependents): Further code reorganization to handle properly main units that are package specifications. 2009-07-27 Geert Bosch <bosch@adacore.com> * einfo.ads (Checks_May_Be_Suppressed): Fix typo in comment * sem_aux.ads: Fix typo in comment * sem_util.ads (Is_LHS): Adjust comment to match body 2009-07-27 Sergey Rybin <rybin@adacore.com> * gnat_ugn.texi (gnatcheck Complex_Inlined_Subprograms rule): Update rule definition. 2009-07-27 Olivier Hainque <hainque@adacore.com> * g-sse.ads, g-ssvety.ads: Update comments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150113 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/exp_attr.adb')
-rw-r--r--gcc/ada/exp_attr.adb15
1 files changed, 12 insertions, 3 deletions
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 2df553c4585..599d0ca5323 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -4682,13 +4682,23 @@ package body Exp_Attr is
---------------------
function Make_Range_Test return Node_Id is
+ Temp : constant Node_Id := Duplicate_Subexpr (Pref);
+
begin
+ -- The value whose validity is being checked has been captured in
+ -- an object declaration. We certainly don't want this object to
+ -- appear valid because the declaration initializes it!
+
+ if Is_Entity_Name (Temp) then
+ Set_Is_Known_Valid (Entity (Temp), False);
+ end if;
+
return
Make_And_Then (Loc,
Left_Opnd =>
Make_Op_Ge (Loc,
Left_Opnd =>
- Unchecked_Convert_To (Btyp, Duplicate_Subexpr (Pref)),
+ Unchecked_Convert_To (Btyp, Temp),
Right_Opnd =>
Unchecked_Convert_To (Btyp,
@@ -4699,8 +4709,7 @@ package body Exp_Attr is
Right_Opnd =>
Make_Op_Le (Loc,
Left_Opnd =>
- Unchecked_Convert_To (Btyp,
- Duplicate_Subexpr_No_Checks (Pref)),
+ Unchecked_Convert_To (Btyp, Temp),
Right_Opnd =>
Unchecked_Convert_To (Btyp,