summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-08 20:21:36 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2011-04-08 20:21:36 +0000
commit9fcbd72c440f25fed0302a49e6da736454fb4f66 (patch)
treeda8a27e7232b2b2616631cf990d2551a1f14c9d6 /gcc/ada
parent409e049a922dec5d9769790764bdaffd8b618ce4 (diff)
downloadgcc-9fcbd72c440f25fed0302a49e6da736454fb4f66.tar.gz
* gcc-interface/trans.c (Identifier_to_gnu): Do not return initializers
of aggregate types that contain a placeholder. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@172209 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/trans.c8
2 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 155256e068c..2046aa715d9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-08 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (Identifier_to_gnu): Do not return initializers
+ of aggregate types that contain a placeholder.
+
2011-04-08 Nathan Froyd <froydnj@codesourcery.com>
* gcc-interface/utils.c (handle_sentinel_attribute): Don't use
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 9622625a7ec..378f88c604d 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -1058,10 +1058,14 @@ Identifier_to_gnu (Node_Id gnat_node, tree *gnu_result_type_p)
/* If we have a constant declaration and its initializer, try to return the
latter to avoid the need to call fold in lots of places and the need for
- elaboration code if this identifier is used as an initializer itself. */
+ elaboration code if this identifier is used as an initializer itself.
+ Don't do it for aggregate types that contain a placeholder since their
+ initializers cannot be manipulated easily. */
if (TREE_CONSTANT (gnu_result)
&& DECL_P (gnu_result)
- && DECL_INITIAL (gnu_result))
+ && DECL_INITIAL (gnu_result)
+ && !(AGGREGATE_TYPE_P (TREE_TYPE (gnu_result))
+ && type_contains_placeholder_p (TREE_TYPE (gnu_result))))
{
bool constant_only = (TREE_CODE (gnu_result) == CONST_DECL
&& !DECL_CONST_CORRESPONDING_VAR (gnu_result));