decl.c (gnat_to_gnu_entity): Always build the UNC variable for aliased objects with...
authorEric Botcazou <ebotcazou@adacore.com>
Sun, 26 May 2013 08:32:34 +0000 (08:32 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Sun, 26 May 2013 08:32:34 +0000 (08:32 +0000)
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Always build the
UNC variable for aliased objects with unconstrained nominal subtype.

From-SVN: r199335

gcc/ada/ChangeLog
gcc/ada/gcc-interface/decl.c

index c072ddf10bb00ec199273ab41567d2b3a657c66b..7c421738e4535539f2a246b343d4d069a4cf5284 100644 (file)
@@ -1,3 +1,8 @@
+2013-05-26  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Always build the
+       UNC variable for aliased objects with unconstrained nominal subtype.
+
 2013-05-24  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/gigi.h (gnat_init_gcc_fp): Declare.
index 6e7c5c45a43ef09663cf5ff8aeeb9fd59ace3f9d..bf334da576145b1141c553ba4bf56f1672e47cb5 100644 (file)
@@ -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