aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/trans.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-11-19 17:49:11 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-11-19 17:49:11 +0000
commit7634135aecceeb3ecaec1873e396d0802056566d (patch)
tree7bf8a6ef5dd30d212402f8afc3d2286823ccd8b4 /gcc/ada/trans.c
parent921d313fd5472454b07f684d59634b738216ed49 (diff)
downloadgcc-7634135aecceeb3ecaec1873e396d0802056566d.zip
gcc-7634135aecceeb3ecaec1873e396d0802056566d.tar.gz
gcc-7634135aecceeb3ecaec1873e396d0802056566d.tar.bz2
re PR ada/34098 (xgcc: Internal error: Segmentation fault (program gnat1))
PR ada/34098 ada/ * misc.c (gnat_adjust_rli): Delete. (gnat_init): Do not initialize the translation code here. Do not call set_lang_adjust_rli. * trans.c (init_code_table): Make static. (gnat_init_stmt_group): Delete. (gigi): Initialize the translation code entirely here. Emit debug info for the common types here instead of... * utils.c (gnat_init_decl_processing): ...here. * gigi.h (init_code_table): Delete. (gnat_init_stmt_group): Likewise. * stor-layout.c (lang_adjust_rli): Delete. (set_lang_adjust_rli): Likewise. (layout_type): Do not call lang_adjust_rli hook. * tree.h (set_lang_adjust_rli): Delete. From-SVN: r130294
Diffstat (limited to 'gcc/ada/trans.c')
-rw-r--r--gcc/ada/trans.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index 449f0f7..df6ab75 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -181,6 +181,7 @@ static enum tree_code gnu_codes[Number_Node_Kinds];
/* Current node being treated, in case abort called. */
Node_Id error_gnat_node;
+static void init_code_table (void);
static void Compilation_Unit_to_gnu (Node_Id);
static void record_code_position (Node_Id);
static void insert_code_for (Node_Id);
@@ -269,6 +270,8 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
}
#endif
+ /* Initialize ourselves. */
+ init_code_table ();
init_gnat_to_gnu ();
gnat_compute_largest_alignment ();
init_dummy_type ();
@@ -281,6 +284,20 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
TYPE_SIZE_UNIT (void_type_node) = size_zero_node;
}
+ /* Enable GNAT stack checking method if needed */
+ if (!Stack_Check_Probes_On_Target)
+ set_stack_check_libfunc (gen_rtx_SYMBOL_REF (Pmode, "_gnat_stack_check"));
+
+ /* Give names and make TYPE_DECLs for common types. */
+ create_type_decl (get_identifier (SIZE_TYPE), sizetype,
+ NULL, false, true, Empty);
+ create_type_decl (get_identifier ("integer"), integer_type_node,
+ NULL, false, true, Empty);
+ create_type_decl (get_identifier ("unsigned char"), char_type_node,
+ NULL, false, true, Empty);
+ create_type_decl (get_identifier ("long integer"), long_integer_type_node,
+ NULL, false, true, Empty);
+
/* Save the type we made for integer as the type for Standard.Integer.
Then make the rest of the standard types. Note that some of these
may be subtypes. */
@@ -313,6 +330,7 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
gnat_init_gcc_eh ();
gcc_assert (Nkind (gnat_root) == N_Compilation_Unit);
+ start_stmt_group ();
Compilation_Unit_to_gnu (gnat_root);
/* Now see if we have any elaboration procedures to deal with. */
@@ -361,20 +379,6 @@ gigi (Node_Id gnat_root, int max_gnat_node, int number_name,
error_gnat_node = Empty;
}
-/* Perform initializations for this module. */
-
-void
-gnat_init_stmt_group (void)
-{
- /* Initialize ourselves. */
- init_code_table ();
- start_stmt_group ();
-
- /* Enable GNAT stack checking method if needed */
- if (!Stack_Check_Probes_On_Target)
- set_stack_check_libfunc (gen_rtx_SYMBOL_REF (Pmode, "_gnat_stack_check"));
-}
-
/* Returns a positive value if GNAT_NODE requires an lvalue for an
operand of OPERAND_TYPE, whose aliasing is specified by ALIASED,
zero otherwise. This is int instead of bool to facilitate usage
@@ -6763,7 +6767,7 @@ post_error_ne_tree_2 (const char *msg,
/* Initialize the table that maps GNAT codes to GCC codes for simple
binary and unary operations. */
-void
+static void
init_code_table (void)
{
gnu_codes[N_And_Then] = TRUTH_ANDIF_EXPR;