* c-decl.c (c_static_assembler_name): Remove TREE_STATIC test.
authorGeoffrey Keating <geoffk@apple.com>
Sat, 26 Jul 2003 07:16:48 +0000 (07:16 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sat, 26 Jul 2003 07:16:48 +0000 (07:16 +0000)
From-SVN: r69808

gcc/ChangeLog
gcc/c-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/intermod-1.c [new file with mode: 0644]

index 292325f..fa369f4 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-25  Geoffrey Keating  <geoffk@apple.com>
+
+       * c-decl.c (c_static_assembler_name): Remove TREE_STATIC test.
+
 2003-07-25  Aldy Hernandez  <aldyh@redhat.com>
 
        * config/rs6000/rs6000.c (is_ev64_opaque_type): Only check pointer
index 5506ac8..20222a5 100644 (file)
@@ -6790,7 +6790,7 @@ void
 c_static_assembler_name (tree decl)
 {
   if (num_in_fnames == 1
-      && TREE_STATIC (decl) && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl)
+      && !TREE_PUBLIC (decl) && DECL_CONTEXT (decl)
       && TREE_CODE (DECL_CONTEXT (decl)) == TRANSLATION_UNIT_DECL)
     SET_DECL_ASSEMBLER_NAME (decl, DECL_NAME (decl));
   else
index 1ee8ffb..2f0e153 100644 (file)
@@ -1,3 +1,7 @@
+2003-07-25  Geoffrey Keating  <geoffk@apple.com>
+
+       * gcc.dg/intermod-1.c: New test.
+
 2003-07-25  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/11617
diff --git a/gcc/testsuite/gcc.dg/intermod-1.c b/gcc/testsuite/gcc.dg/intermod-1.c
new file mode 100644 (file)
index 0000000..296adf9
--- /dev/null
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-final { scan-assembler-not {foo[1-9]\.} } } */
+
+/* Check that we don't get .0 suffixes on static variables when not using
+   intermodule analysis.  */
+
+static int foo1;
+static int foo2 = 1;
+
+static void foo5(void) {  }
+static void foo6(void);
+static void foo6(void) { }
+static void foo7(void);
+void foo7(void) { }
+
+void foo9(void) 
+{
+  foo1 = 2;
+  foo2 = 3;
+  foo5();
+  foo6();
+  foo7();
+}