This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Ada] Fix non-determinicity of symbol names
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Mon, 15 Sep 2008 22:27:41 +0200
- Subject: [Ada] Fix non-determinicity of symbol names
Because of the naming scheme used by GNAT, it is possible to completely
eliminate the small non-determinicity of symbol names stemming from the
get_file_function_name routine.
Tested on i586-suse-linux, applied on the mainline.
2008-09-15 Eric Botcazou <ebotcazou@adacore.com>
* gcc-interface/trans.c (gigi): Declare the name of the compilation
unit as the first global name.
--
Eric Botcazou
Index: gcc-interface/trans.c
===================================================================
--- gcc-interface/trans.c (revision 135025)
+++ gcc-interface/trans.c (revision 135026)
@@ -387,10 +387,17 @@ gigi (Node_Id gnat_root, int max_gnat_no
gnat_init_gcc_eh ();
gcc_assert (Nkind (gnat_root) == N_Compilation_Unit);
+
+ /* Declare the name of the compilation unit as the first global
+ name in order to make the middle-end fully deterministic. */
+ t = create_concat_name (Defining_Entity (Unit (gnat_root)), NULL);
+ first_global_object_name = ggc_strdup (IDENTIFIER_POINTER (t));
+
+ /* Now translate the compilation unit proper. */
start_stmt_group ();
Compilation_Unit_to_gnu (gnat_root);
- /* Now see if we have any elaboration procedures to deal with. */
+ /* Finally see if we have any elaboration procedures to deal with. */
for (info = elab_info_list; info; info = info->next)
{
tree gnu_body = DECL_SAVED_TREE (info->elab_proc);