From: Matt Austern Date: Wed, 17 Mar 2004 21:52:16 +0000 (+0000) Subject: backport: re PR debug/14079 (wrong debug info for extern boolean variable in debug... X-Git-Tag: releases/gcc-3.3.4~149 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd4701a8ba5d2825409af00e4b423391a0aa3092;p=thirdparty%2Fgcc.git backport: re PR debug/14079 (wrong debug info for extern boolean variable in debug mode) Backport: PR debug/14079 * decl.c (add_decl_to_level): Add extern variables, as well as static, to static_decls array. From-SVN: r79608 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 99f5d2193f36..b3398a064604 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,10 @@ +2003-03-17 Matt Austern + + Backport: + PR debug/14079 + * decl.c (add_decl_to_level): Add extern variables, as well + as static, to static_decls array. + 2004-03-12 Gabriel Dos Reis Backport: diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index f9a8e9957d88..902416d24df0 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -1286,9 +1286,13 @@ add_decl_to_level (decl, b) b->names = decl; b->names_size++; - /* If appropriate, add decl to separate list of statics */ + /* If appropriate, add decl to separate list of statics. We + include extern variables because they might turn out to be + static later. It's OK for this list to contain a few false + positives. */ if (b->namespace_p) - if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) + if ((TREE_CODE (decl) == VAR_DECL + && (TREE_STATIC (decl) || DECL_EXTERNAL (decl))) || (TREE_CODE (decl) == FUNCTION_DECL && (!TREE_PUBLIC (decl) || DECL_DECLARED_INLINE_P (decl)))) VARRAY_PUSH_TREE (b->static_decls, decl);