varasm.c (default_binds_local_p): Check TREE_PUBLIC before DECL_EXTERNAL.
authorRichard Henderson <rth@redhat.com>
Tue, 28 May 2002 20:08:29 +0000 (13:08 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 28 May 2002 20:08:29 +0000 (13:08 -0700)
        * varasm.c (default_binds_local_p): Check TREE_PUBLIC before
        DECL_EXTERNAL.

From-SVN: r53963

gcc/ChangeLog
gcc/varasm.c

index 6e0c9a4da9e76d190f0f5342dd681dd25d0dd809..dad6de4700c3ea4c3d20d4268f3739324cf256a0 100644 (file)
@@ -6,6 +6,9 @@
        invalidated_by_call.  Initialize from regs_invalidated_by_call
        instead of call_used_regs.
 
+       * varasm.c (default_binds_local_p): Check TREE_PUBLIC before
+       DECL_EXTERNAL.
+
 2002-05-28  Zack Weinberg  <zack@codesourcery.com>
 
        * tree.h: Forward-declare struct realvaluetype.
index 89eb47e92dc2af2ab9b78e8fe7fd827a6c837e3c..73ba7cdd11c18c0a2c9448290d5e530eddd054db 100644 (file)
@@ -5597,7 +5597,10 @@ default_binds_local_p (exp)
   /* A non-decl is an entry in the constant pool.  */
   if (!DECL_P (exp))
     local_p = true;
-  /* A variable is considered "local" if it is defined by this module.  */
+  /* Static variables are always local.  */
+  else if (! TREE_PUBLIC (exp))
+    local_p = true;
+  /* A variable is local if the user tells us so.  */
   else if (MODULE_LOCAL_P (exp))
     local_p = true;
   /* Otherwise, variables defined outside this object may not be local.  */
@@ -5606,9 +5609,6 @@ default_binds_local_p (exp)
   /* Linkonce and weak data are never local.  */
   else if (DECL_ONE_ONLY (exp) || DECL_WEAK (exp))
     local_p = false;
-  /* Static variables are always local.  */
-  else if (! TREE_PUBLIC (exp))
-    local_p = true;
   /* If PIC, then assume that any global name can be overridden by
      symbols resolved from other modules.  */
   else if (flag_pic)