summaryrefslogtreecommitdiffstats
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-26 08:32:34 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-05-26 08:32:34 +0000
commit77509f1fad3507f668b2f9a440c428c13153d334 (patch)
tree26512d5a4f50145a70ef1b623681145b3078bf56 /gcc/ada/gcc-interface/decl.c
parent40fa6d3a10d4cb9b3d09fa7440e76cc04efbd018 (diff)
downloadppe42-gcc-77509f1fad3507f668b2f9a440c428c13153d334.tar.gz
ppe42-gcc-77509f1fad3507f668b2f9a440c428c13153d334.zip
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Always build the
UNC variable for aliased objects with unconstrained nominal subtype. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@199335 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c31
1 files changed, 12 insertions, 19 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6e7c5c45a43..bf334da5761 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -1411,26 +1411,19 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
just above, we have nothing to do here. */
if (!TYPE_IS_THIN_POINTER_P (gnu_type))
{
- gnu_size = NULL_TREE;
- used_by_ref = true;
+ tree gnu_unc_var
+ = create_var_decl (concat_name (gnu_entity_name, "UNC"),
+ NULL_TREE, gnu_type, gnu_expr,
+ const_flag, Is_Public (gnat_entity),
+ imported_p || !definition, static_p,
+ NULL, gnat_entity);
+ gnu_expr
+ = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_unc_var);
+ TREE_CONSTANT (gnu_expr) = 1;
- if (definition && !imported_p)
- {
- tree gnu_unc_var
- = create_var_decl (concat_name (gnu_entity_name, "UNC"),
- NULL_TREE, gnu_type, gnu_expr,
- const_flag, Is_Public (gnat_entity),
- false, static_p, NULL, gnat_entity);
- gnu_expr
- = build_unary_op (ADDR_EXPR, NULL_TREE, gnu_unc_var);
- TREE_CONSTANT (gnu_expr) = 1;
- const_flag = true;
- }
- else
- {
- gnu_expr = NULL_TREE;
- const_flag = false;
- }
+ gnu_size = NULL_TREE;
+ used_by_ref = true;
+ const_flag = true;
}
gnu_type
OpenPOWER on IntegriCloud