summaryrefslogtreecommitdiff
path: root/gcc/ada/gcc-interface/decl.c
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-08 05:57:48 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2008-10-08 05:57:48 +0000
commitc95b9ae3504a8da1a31c1ed2224f97b3d4b829a2 (patch)
tree775928cf6a1e9f1553ce9d66715128ff7443febe /gcc/ada/gcc-interface/decl.c
parent6b478e0035aa8103bd1985b85280892386cd32ef (diff)
downloadgcc-c95b9ae3504a8da1a31c1ed2224f97b3d4b829a2.tar.gz
2008-10-08 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk r140962 git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@140963 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r--gcc/ada/gcc-interface/decl.c68
1 files changed, 34 insertions, 34 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index b0dfc7d33e4..cdee2277608 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -828,22 +828,6 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
"PAD", false, definition,
gnu_size ? true : false);
- /* Make a volatile version of this object's type if we are to make
- the object volatile. We also interpret 13.3(19) conservatively
- and disallow any optimizations for an object covered by it. */
- if ((Treat_As_Volatile (gnat_entity)
- || (Is_Exported (gnat_entity)
- /* Exclude exported constants created by the compiler,
- which should boil down to static dispatch tables and
- make it possible to put them in read-only memory. */
- && (Comes_From_Source (gnat_entity) || !const_flag))
- || Is_Imported (gnat_entity)
- || Present (Address_Clause (gnat_entity)))
- && !TYPE_VOLATILE (gnu_type))
- gnu_type = build_qualified_type (gnu_type,
- (TYPE_QUALS (gnu_type)
- | TYPE_QUAL_VOLATILE));
-
/* If this is a renaming, avoid as much as possible to create a new
object. However, in several cases, creating it is required.
This processing needs to be applied to the raw expression so
@@ -991,22 +975,38 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
}
}
- /* If this is an aliased object whose nominal subtype is unconstrained,
- the object is a record that contains both the template and
- the object. If there is an initializer, it will have already
- been converted to the right type, but we need to create the
- template if there is no initializer. */
- else if (definition
- && TREE_CODE (gnu_type) == RECORD_TYPE
- && (TYPE_CONTAINS_TEMPLATE_P (gnu_type)
- /* Beware that padding might have been introduced
- via maybe_pad_type above. */
- || (TYPE_IS_PADDING_P (gnu_type)
- && TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type)))
- == RECORD_TYPE
- && TYPE_CONTAINS_TEMPLATE_P
- (TREE_TYPE (TYPE_FIELDS (gnu_type)))))
- && !gnu_expr)
+ /* Make a volatile version of this object's type if we are to make
+ the object volatile. We also interpret 13.3(19) conservatively
+ and disallow any optimizations for an object covered by it. */
+ if ((Treat_As_Volatile (gnat_entity)
+ || (Is_Exported (gnat_entity)
+ /* Exclude exported constants created by the compiler,
+ which should boil down to static dispatch tables and
+ make it possible to put them in read-only memory. */
+ && (Comes_From_Source (gnat_entity) || !const_flag))
+ || Is_Imported (gnat_entity)
+ || Present (Address_Clause (gnat_entity)))
+ && !TYPE_VOLATILE (gnu_type))
+ gnu_type = build_qualified_type (gnu_type,
+ (TYPE_QUALS (gnu_type)
+ | TYPE_QUAL_VOLATILE));
+
+ /* If we are defining an aliased object whose nominal subtype is
+ unconstrained, the object is a record that contains both the
+ template and the object. If there is an initializer, it will
+ have already been converted to the right type, but we need to
+ create the template if there is no initializer. */
+ if (definition
+ && !gnu_expr
+ && TREE_CODE (gnu_type) == RECORD_TYPE
+ && (TYPE_CONTAINS_TEMPLATE_P (gnu_type)
+ /* Beware that padding might have been introduced
+ via maybe_pad_type above. */
+ || (TYPE_IS_PADDING_P (gnu_type)
+ && TREE_CODE (TREE_TYPE (TYPE_FIELDS (gnu_type)))
+ == RECORD_TYPE
+ && TYPE_CONTAINS_TEMPLATE_P
+ (TREE_TYPE (TYPE_FIELDS (gnu_type))))))
{
tree template_field
= TYPE_IS_PADDING_P (gnu_type)
@@ -1328,7 +1328,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
&& (definition || Sloc (gnat_entity) > Standard_Location)
&& ((Is_Public (gnat_entity)
&& !Present (Address_Clause (gnat_entity)))
- || optimize == 0
+ || !optimize
|| Address_Taken (gnat_entity)
|| Is_Aliased (gnat_entity)
|| Is_Aliased (Etype (gnat_entity))))
@@ -1343,7 +1343,7 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
/* As debugging information will be generated for the variable,
do not generate information for the constant. */
- DECL_IGNORED_P (gnu_decl) = true;
+ DECL_IGNORED_P (gnu_decl) = 1;
}
/* If this is declared in a block that contains a block with an