diff options
author | Richard Henderson <rth@redhat.com> | 2002-05-28 13:08:29 -0700 |
---|---|---|
committer | Richard Henderson <rth@gcc.gnu.org> | 2002-05-28 13:08:29 -0700 |
commit | 923c7cdfa776a4ebc6ff759d2a775ebb81cb8ac5 (patch) | |
tree | 91402aa0ab127e6ee19b119df061b14a8856756a /gcc | |
parent | f3ea5f6ac344809ee93430dba4f97b86c7cd6e31 (diff) | |
download | gcc-923c7cdfa776a4ebc6ff759d2a775ebb81cb8ac5.zip gcc-923c7cdfa776a4ebc6ff759d2a775ebb81cb8ac5.tar.gz gcc-923c7cdfa776a4ebc6ff759d2a775ebb81cb8ac5.tar.bz2 |
varasm.c (default_binds_local_p): Check TREE_PUBLIC before DECL_EXTERNAL.
* varasm.c (default_binds_local_p): Check TREE_PUBLIC before
DECL_EXTERNAL.
From-SVN: r53963
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/varasm.c | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6e0c9a4..dad6de4 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -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. diff --git a/gcc/varasm.c b/gcc/varasm.c index 89eb47e..73ba7cd 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -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) |