summaryrefslogtreecommitdiff
path: root/gcc/ada/exp_ch13.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-05 09:18:41 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-05 09:18:41 +0000
commit64427fe6ce86dfbdaffab4f2ebe85c229013caaf (patch)
tree14345a5db40998ad4c46f9b87480f6d04a270075 /gcc/ada/exp_ch13.adb
parent69a5377d49c2fc7e55fc075cf5e258555abb0aff (diff)
downloadgcc-64427fe6ce86dfbdaffab4f2ebe85c229013caaf.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@162906 138bc75d-0d04-0410-961f-82ee72b054a4
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 d0004f473a0..6e8fa823d91 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;