OSDN Git Service

* gcc-interface/utils.c (gnat_write_global_declarations): Put a name
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 May 2012 09:46:42 +0000 (09:46 +0000)
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 20 May 2012 09:46:42 +0000 (09:46 +0000)
on the dummy global variable.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@187693 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/gcc-interface/utils.c
gcc/testsuite/ChangeLog
gcc/testsuite/gnat.dg/lto13.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/lto13_pkg.adb [new file with mode: 0644]
gcc/testsuite/gnat.dg/lto13_pkg.ads [new file with mode: 0644]

index abc5668..9bad95e 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gcc-interface/utils.c (gnat_write_global_declarations): Put a name
+       on the dummy global variable.
+
 2012-05-19  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gcc-interface/decl.c (Has_Thiscall_Convention): New macro.
index 83ed782..4596c52 100644 (file)
@@ -4909,8 +4909,12 @@ gnat_write_global_declarations (void)
   if (!VEC_empty (tree, types_used_by_cur_var_decl))
     {
       struct varpool_node *node;
+      char *label;
+
+      ASM_FORMAT_PRIVATE_NAME (label, first_global_object_name, 0);
       dummy_global
-       = build_decl (BUILTINS_LOCATION, VAR_DECL, NULL_TREE, void_type_node);
+       = build_decl (BUILTINS_LOCATION, VAR_DECL, get_identifier (label),
+                     void_type_node);
       TREE_STATIC (dummy_global) = 1;
       TREE_ASM_WRITTEN (dummy_global) = 1;
       node = varpool_node (dummy_global);
index f60b86e..1c35155 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-20  Eric Botcazou  <ebotcazou@adacore.com>
+
+       * gnat.dg/lto13.adb: New test.
+       * gnat.dg/lto13_pkg.ad[sb]: New helper.
+
 2012-05-18  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/specs/lto12.ads: New test.
diff --git a/gcc/testsuite/gnat.dg/lto13.adb b/gcc/testsuite/gnat.dg/lto13.adb
new file mode 100644 (file)
index 0000000..7c7fe16
--- /dev/null
@@ -0,0 +1,9 @@
+-- { dg-do link }
+-- { dg-options "-g -flto" { target lto } }
+
+with Lto13_Pkg; use Lto13_Pkg;
+
+procedure Lto13 is
+begin
+  Proc;
+end;
diff --git a/gcc/testsuite/gnat.dg/lto13_pkg.adb b/gcc/testsuite/gnat.dg/lto13_pkg.adb
new file mode 100644 (file)
index 0000000..f8b5057
--- /dev/null
@@ -0,0 +1,10 @@
+package body Lto13_Pkg is
+
+  procedure Proc is
+  begin
+    raise Constraint_Error;
+  end;
+
+  type T is null record;
+
+end Lto13_Pkg;
diff --git a/gcc/testsuite/gnat.dg/lto13_pkg.ads b/gcc/testsuite/gnat.dg/lto13_pkg.ads
new file mode 100644 (file)
index 0000000..ce91d1c
--- /dev/null
@@ -0,0 +1,9 @@
+package Lto13_Pkg is
+
+  procedure Proc;
+
+private
+
+  type T;
+
+end Lto13_Pkg;