aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2010-08-05 11:18:41 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2010-08-05 11:18:41 +0200
commit0d90129062e7e64a15adf3a0ec5120a2cf8ea7ee (patch)
tree14345a5db40998ad4c46f9b87480f6d04a270075 /gcc/ada/exp_ch13.adb
parent676e842077eef03dde5c478d38906d353c81cf1b (diff)
downloadgcc-0d90129062e7e64a15adf3a0ec5120a2cf8ea7ee.zip
gcc-0d90129062e7e64a15adf3a0ec5120a2cf8ea7ee.tar.gz
gcc-0d90129062e7e64a15adf3a0ec5120a2cf8ea7ee.tar.bz2
[multiple changes]
2010-08-05 Thomas Quinot <quinot@adacore.com> * exp_ch4.adb: Minor reformatting * gnat1drv.adb: Minor reformatting. Minor code reorganization (use Nkind_In). 2010-08-05 Ed Schonberg <schonberg@adacore.com> * exp_util.ads, exp_util.adb (Needs_Constant_Address): New predicate to determine whether the expression in an address clause for an initialized object must be constant. Code moved from freeze.adb. (Remove_Side_Effects): When the temporary is initialized with a reference, indicate that the temporary is a constant as done in all other cases. * freeze.adb (Check_Address_Clause): use Needs_Constant_Address. * exp_ch13.adb (Expand_N_Attribute_Definition_Clause, case 'Address): If object does not need a constant address, remove side effects from address expression, so it is elaborated at the point of the address clause and not at the freeze point of the object, so that elaboration order is respected. 2010-08-05 Vincent Celier <celier@adacore.com> * prj.adb (Is_Compilable): Return False for header files of non Ada languages. 2010-08-05 Emmanuel Briot <briot@adacore.com> * prj-nmsc.adb: The Missing_Source_Files flag also considers a missing exec directory as a warning rather than an error. From-SVN: r162906
Diffstat (limited to 'gcc/ada/exp_ch13.adb')
-rw-r--r--gcc/ada/exp_ch13.adb10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/ada/exp_ch13.adb b/gcc/ada/exp_ch13.adb
index d0004f4..6e8fa82 100644
--- a/gcc/ada/exp_ch13.adb
+++ b/gcc/ada/exp_ch13.adb
@@ -127,6 +127,16 @@ package body Exp_Ch13 is
else
Set_Expression (Decl, Empty);
end if;
+
+ -- An object declaration to which an address clause applies
+ -- has a delayed freeze, but the address expression itself
+ -- must be elaborated at the point it appears. If the object
+ -- is controlled, additional checks apply elsewhere.
+
+ elsif Nkind (Decl) = N_Object_Declaration
+ and then not Needs_Constant_Address (Decl, Typ)
+ then
+ Remove_Side_Effects (Exp);
end if;
end;