aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/utils.c
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2004-07-13 23:40:51 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2004-07-13 23:40:51 +0200
commita5cb3b30256cbaa017ed825c6f7778166499a0a6 (patch)
treeca4e054f37d2b08bfcf30ed0bd62cba30a72b076 /gcc/ada/utils.c
parent1ff3c0761f1732883f5c1b5bd5c9b6a6f53c4b49 (diff)
downloadgcc-a5cb3b30256cbaa017ed825c6f7778166499a0a6.zip
gcc-a5cb3b30256cbaa017ed825c6f7778166499a0a6.tar.gz
gcc-a5cb3b30256cbaa017ed825c6f7778166499a0a6.tar.bz2
[multiple changes]
2004-07-13 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * decl.c: (gnat_to_gnu_entity, object case): Convert initializer to object type. (gnat_to_gnu_entity, case E_Record_Subtype): Properly set TYPE_STUB_DECL. * misc.c (gnat_types_compatible_p): New function. (LANG_HOOKS_TYPES_COMPATIBLE_P): New hook, to use it. (LANG_HOOKS_TYPE_MAX_SIZE, gnat_type_max_size): New. * trans.c (gigi): Move processing of main N_Compilation_Unit here. (gnat_to_gnu, case N_Compilation_Unit): Just handle nested case here. (add_stmt): Force walking of sizes and DECL_INITIAL for DECL_EXPR. (mark_visited): Don't mark dummy type. (tree_transform <N_Procedure_Call_Statement>): Unless this is an In parameter, we must remove any LJM building from GNU_NAME. (gnat_to_gnu, case N_String_Literal): Fill in indices in CONSTRUCTOR. (pos_to_constructor): Use int_const_binop. (gnat_to_gnu, case N_Identifier): Don't reference DECL_INITIAL of PARM_DECL. * utils.c (gnat_init_decl_processing): Don't make two "void" decls. (gnat_pushlevel): Set TREE_USE on BLOCK node. (gnat_install_builtins): Add __builtin_memset. 2004-07-13 Olivier Hainque <hainque@act-europe.fr> * decl.c (gnat_to_gnu_entity <E_Variable>): If we are making a pointer for a renaming, stabilize the initialization expression if we are at a local level. At the local level, uses of the renaming may be performed by a direct dereference of the initializing expression, and we don't want possible variables there to be evaluated for every use. * trans.c (gnat_stabilize_reference, gnat_stabilize_reference_1): Propagate TREE_SIDE_EFFECTS and TREE_THIS_VOLATILE to avoid loosing them on the way. Account for the fact that we may introduce side effects in the process. From-SVN: r84647
Diffstat (limited to 'gcc/ada/utils.c')
-rw-r--r--gcc/ada/utils.c32
1 files changed, 10 insertions, 22 deletions
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index 772fdd4..dc8a5b1 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -230,6 +230,7 @@ gnat_pushlevel ()
BLOCK_SUPERCONTEXT (newlevel->block) = current_binding_level->block;
BLOCK_VARS (newlevel->block) = BLOCK_SUBBLOCKS (newlevel->block) = NULL_TREE;
+ TREE_USED (newlevel->block) = 1;
/* Add this level to the front of the chain (stack) of levels that are
active. */
@@ -362,7 +363,7 @@ gnat_pushdecl (tree decl, Node_Id gnat_node)
&& DECL_ARTIFICIAL (TYPE_NAME (TREE_TYPE (decl)))
&& ! DECL_ARTIFICIAL (decl))))
TYPE_NAME (TREE_TYPE (decl)) = decl;
-
+
if (TREE_CODE (decl) != CONST_DECL)
rest_of_decl_compilation (decl, NULL, global_bindings_p (), 0);
}
@@ -404,9 +405,6 @@ gnat_init_decl_processing (void)
gnat_pushdecl (build_decl (TYPE_DECL, get_identifier ("long integer"),
long_integer_type_node),
Empty);
- gnat_pushdecl (build_decl (TYPE_DECL, get_identifier ("void"),
- void_type_node),
- Empty);
ptr_void_type_node = build_pointer_type (void_type_node);
@@ -464,6 +462,13 @@ gnat_install_builtins ()
gnat_define_builtin ("__builtin_memcmp", ftype, BUILT_IN_MEMCMP,
"memcmp", false);
+ tmp = tree_cons (NULL_TREE, size_type_node, void_list_node);
+ tmp = tree_cons (NULL_TREE, integer_type_node, tmp);
+ tmp = tree_cons (NULL_TREE, ptr_void_type_node, tmp);
+ ftype = build_function_type (integer_type_node, tmp);
+ gnat_define_builtin ("__builtin_memset", ftype, BUILT_IN_MEMSET,
+ "memset", false);
+
tmp = tree_cons (NULL_TREE, integer_type_node, void_list_node);
ftype = build_function_type (integer_type_node, tmp);
gnat_define_builtin ("__builtin_clz", ftype, BUILT_IN_CLZ, "clz", true);
@@ -2827,10 +2832,8 @@ convert (tree type, tree expr)
return expr;
case STRING_CST:
- case CONSTRUCTOR:
/* If we are converting a STRING_CST to another constrained array type,
- just make a new one in the proper type. Likewise for
- CONSTRUCTOR if the alias sets are the same. */
+ just make a new one in the proper type. */
if (code == ecode && AGGREGATE_TYPE_P (etype)
&& ! (TREE_CODE (TYPE_SIZE (etype)) == INTEGER_CST
&& TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
@@ -2843,21 +2846,6 @@ convert (tree type, tree expr)
}
break;
- case COMPONENT_REF:
- /* If we are converting between two aggregate types of the same
- kind, size, mode, and alignment, just make a new COMPONENT_REF.
- This avoid unneeded conversions which makes reference computations
- more complex. */
- if (code == ecode && TYPE_MODE (type) == TYPE_MODE (etype)
- && AGGREGATE_TYPE_P (type) && AGGREGATE_TYPE_P (etype)
- && TYPE_ALIGN (type) == TYPE_ALIGN (etype)
- && operand_equal_p (TYPE_SIZE (type), TYPE_SIZE (etype), 0)
- && get_alias_set (type) == get_alias_set (etype))
- return build (COMPONENT_REF, type, TREE_OPERAND (expr, 0),
- TREE_OPERAND (expr, 1), NULL_TREE);
-
- break;
-
case UNCONSTRAINED_ARRAY_REF:
/* Convert this to the type of the inner array by getting the address of
the array from the template. */