aboutsummaryrefslogtreecommitdiff
path: root/gcc/cgraphunit.c
diff options
context:
space:
mode:
authorJan Hubicka <jh@suse.cz>2005-08-18 17:22:46 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2005-08-18 15:22:46 +0000
commitf17db6cd86ad1c3a67951f02abe211545efe10ef (patch)
treec1f99fa18011cb80b0ba29f6f480ccdc113baf38 /gcc/cgraphunit.c
parent4286d8cedb37a8cc0080f5e7a62dda647005eed9 (diff)
downloadgcc-f17db6cd86ad1c3a67951f02abe211545efe10ef.zip
gcc-f17db6cd86ad1c3a67951f02abe211545efe10ef.tar.gz
gcc-f17db6cd86ad1c3a67951f02abe211545efe10ef.tar.bz2
re PR c++/22034 (ICE on valid (local class), dwarf2)
PR c++/22034 * cgraphunit.c (cgraph_varpool_assemble_pending_decls): Emit debug info only for local statics, not for member variables. From-SVN: r103251
Diffstat (limited to 'gcc/cgraphunit.c')
-rw-r--r--gcc/cgraphunit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index a10859d..012cb7c 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -814,7 +814,10 @@ cgraph_varpool_assemble_pending_decls (void)
assemble_variable (decl, 0, 1, 0);
/* Local static variables are never seen by check_global_declarations
so we need to output debug info by hand. */
- if (decl_function_context (decl) && errorcount == 0 && sorrycount == 0)
+ if (DECL_CONTEXT (decl)
+ && (TREE_CODE (DECL_CONTEXT (decl)) == BLOCK
+ || TREE_CODE (DECL_CONTEXT (decl)) == FUNCTION_DECL)
+ && errorcount == 0 && sorrycount == 0)
{
timevar_push (TV_SYMOUT);
(*debug_hooks->global_decl) (decl);