diff options
author | Devang Patel <dpatel@apple.com> | 2005-10-05 17:47:21 -0700 |
---|---|---|
committer | Devang Patel <dpatel@gcc.gnu.org> | 2005-10-05 17:47:21 -0700 |
commit | d6b27b56a238b4345b54627d5ee41c85adf05ea1 (patch) | |
tree | 1679f9c1b58000cf3ef376de40b984227982359c /gcc/dbxout.c | |
parent | 2d99a2ffb1241a9c6d951918c71d5f9202c2bc23 (diff) | |
download | gcc-d6b27b56a238b4345b54627d5ee41c85adf05ea1.zip gcc-d6b27b56a238b4345b54627d5ee41c85adf05ea1.tar.gz gcc-d6b27b56a238b4345b54627d5ee41c85adf05ea1.tar.bz2 |
re PR debug/23205 ([C++/unit-at-a-time] stabs debug info omitted for global const variables)
PR Debug/23205
* dbxout.c (dbxout_symbol): Check DECL_RTL_SET_P, after
handling constants. Check NAMESPACE_DECL context for constants.
* g++.dg/other/PR23205.C: New.
From-SVN: r105028
Diffstat (limited to 'gcc/dbxout.c')
-rw-r--r-- | gcc/dbxout.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/gcc/dbxout.c b/gcc/dbxout.c index d295ac7..9ffced0 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -2671,10 +2671,6 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) if (DECL_EXTERNAL (decl)) break; - decl_rtl = dbxout_expand_expr (decl); - if (!decl_rtl) - DBXOUT_DECR_NESTING_AND_RETURN (0); - /* If the variable is really a constant and not written in memory, inform the debugger. @@ -2684,7 +2680,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) && host_integerp (DECL_INITIAL (decl), 0) && ! TREE_ASM_WRITTEN (decl) && (DECL_CONTEXT (decl) == NULL_TREE - || TREE_CODE (DECL_CONTEXT (decl)) == BLOCK) + || TREE_CODE (DECL_CONTEXT (decl)) == BLOCK + || TREE_CODE (DECL_CONTEXT (decl)) == NAMESPACE_DECL) && TREE_PUBLIC (decl) == 0) { /* The sun4 assembler does not grok this. */ @@ -2695,8 +2692,8 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) HOST_WIDE_INT ival = TREE_INT_CST_LOW (DECL_INITIAL (decl)); dbxout_begin_complex_stabs (); - stabstr_I (DECL_NAME (decl)); - stabstr_S (":c=i"); + dbxout_symbol_name (decl, NULL, 'c'); + stabstr_S ("=i"); stabstr_D (ival); dbxout_finish_complex_stabs (0, N_LSYM, 0, 0, 0); DBXOUT_DECR_NESTING; @@ -2707,6 +2704,10 @@ dbxout_symbol (tree decl, int local ATTRIBUTE_UNUSED) } /* else it is something we handle like a normal variable. */ + decl_rtl = dbxout_expand_expr (decl); + if (!decl_rtl) + DBXOUT_DECR_NESTING_AND_RETURN (0); + decl_rtl = eliminate_regs (decl_rtl, 0, NULL_RTX); #ifdef LEAF_REG_REMAP if (current_function_uses_only_leaf_regs) |