aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2011-04-08 20:21:36 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2011-04-08 20:21:36 +0000
commit88872b00daeaf461796962afeb8901c172aacc50 (patch)
treeda8a27e7232b2b2616631cf990d2551a1f14c9d6 /gcc/ada/gcc-interface/trans.c
parent42821aff0aa8c8118a0e19c2dc640b24ad26e1dc (diff)
downloadgcc-88872b00daeaf461796962afeb8901c172aacc50.zip
gcc-88872b00daeaf461796962afeb8901c172aacc50.tar.gz
gcc-88872b00daeaf461796962afeb8901c172aacc50.tar.bz2
trans.c (Identifier_to_gnu): Do not return initializers of aggregate types that contain a placeholder.
* gcc-interface/trans.c (Identifier_to_gnu): Do not return initializers of aggregate types that contain a placeholder. From-SVN: r172209
Diffstat (limited to 'gcc/ada/gcc-interface/trans.c')
-rw-r--r--gcc/ada/gcc-interface/trans.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index 9622625..378f88c 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));