This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/21828] [4.0/4.1 Regression] debug info omitted for global variables
- From: "bonzini at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 31 May 2005 13:11:27 -0000
- Subject: [Bug debug/21828] [4.0/4.1 Regression] debug info omitted for global variables
- References: <20050530184504.21828.bonzini@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bonzini at gcc dot gnu dot org 2005-05-31 13:11 -------
Ulrich Weigand wrote:
When building with -funit-at-a-time (which is on by default with -O2), *no*
debug info for global variables appears to be emitted at all.
The problem appears to be this piece of code in check_global_declarations:
/* Do not emit debug information about variables that are in
static storage, but not defined. */
if (TREE_CODE (decl) == VAR_DECL
&& TREE_STATIC (decl)
&& !TREE_ASM_WRITTEN (decl))
DECL_IGNORED_P (decl) = 1;
which was added by:
http://gcc.gnu.org/ml/gcc-cvs/2004-11/msg01250.html
2004-11-25 Mark Mitchell <mark@codesourcery.com>
PR c++/18556
* toplev.c (check_global_declarations): Set DECL_IGNORED_P on
unemitted variables with static storage duration.
However, check_global_declarations is called (by the C front-end at least)
*before* the call to cgraph_optimize. At this time, when -funit-at-a-time
is in effect, *no* variables have been emitted to assembler as far as I
can tell, and thus all global variables get the DECL_IGNORED_P flag.
Interestingly enough, when building with the C++ front-end, the debug
info is properly emitted. I'm not sure where exactly the difference is ...
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |uweigand at de dot ibm dot
| |com, mark at codesourcery
| |dot com
Severity|normal |critical
GCC target triplet|powerpc-apple-darwin7.9.0 |
Priority|P2 |P1
Summary|[4.1 Regression] stabs debug|[4.0/4.1 Regression] debug
|info completely broken? |info omitted for global
| |variables
Target Milestone|--- |4.0.1
Version|4.1.0 |4.0.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21828