summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2009-04-07 10:58:37 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2009-04-07 10:58:37 +0000
commitd5859bf49d3745d613c621bacf6a06f49fda593e (patch)
tree6874347a3afbfaa7325e34c48e7854e6b4c0bf4d
parentc86f07f6bf104142c3161433a7ca43e30cc11bde (diff)
downloadgcc-d5859bf49d3745d613c621bacf6a06f49fda593e.tar.gz
decl.c (gnat_to_gnu_entity): Test the underlying type.
* gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Test the underlying type. * gcc-interface/trans.c (lvalue_required_p): Likewise. From-SVN: r145663
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/gcc-interface/decl.c4
-rw-r--r--gcc/ada/gcc-interface/trans.c3
3 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d0a953d6146..d2a58c371ec 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2009-04-07 Eric Botcazou <ebotcazou@adacore.com>
+ * gcc-interface/decl.c (gnat_to_gnu_entity) <object>: Test the
+ underlying type.
+ * gcc-interface/trans.c (lvalue_required_p): Likewise.
+
+2009-04-07 Eric Botcazou <ebotcazou@adacore.com>
+
* gcc-interface/trans.c (Attribute_to_gnu) <Max_Size_In_Storage_Elmts>:
Do not convert the result. Remove obsolete comment.
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 6cf616e961b..5984027e964 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -886,7 +886,9 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* Case 3: If this is a constant renaming and creating a
new object is allowed and cheap, treat it as a normal
object whose initial value is what is being renamed. */
- if (const_flag && Is_Elementary_Type (Etype (gnat_entity)))
+ if (const_flag
+ && !Is_Composite_Type
+ (Underlying_Type (Etype (gnat_entity))))
;
/* Case 4: Make this into a constant pointer to the object we
diff --git a/gcc/ada/gcc-interface/trans.c b/gcc/ada/gcc-interface/trans.c
index b505c887b6c..309617d35d1 100644
--- a/gcc/ada/gcc-interface/trans.c
+++ b/gcc/ada/gcc-interface/trans.c
@@ -730,7 +730,8 @@ lvalue_required_p (Node_Id gnat_node, tree gnu_type, int aliased)
attached to the CONST_DECL. */
return (aliased != 0
/* This should match the constant case of the renaming code. */
- || Is_Composite_Type (Etype (Name (gnat_parent)))
+ || Is_Composite_Type
+ (Underlying_Type (Etype (Name (gnat_parent))))
|| Nkind (Name (gnat_parent)) == N_Identifier);
default: