[Bug debug/55608] New: [4.6/4.7/4.8 Regression] Debug info quality regressions with file scope vars

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 6 08:58:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55608

             Bug #: 55608
           Summary: [4.6/4.7/4.8 Regression] Debug info quality
                    regressions with file scope vars
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
        AssignedTo: jakub@gcc.gnu.org
        ReportedBy: jakub@gcc.gnu.org


static const char *a = "opq";
static const char b[8] = "rstuv";

int
main ()
{
  const char *p = "abcd";
  const char *q = "efgh";
  const char r[] = "ijk\0lmn";
  const char *s = r;
  return 0;
}

at -g -O2, gdb ./test; b main; p a; p b
shows
(gdb) p a
$1 = 0x400560 "opq"
(gdb) p b
$2 = "rstuv\000\000"
in e.g. GCC 3.2 or 3.3, but later on it is <optimized out>.  This is related to
PR55395, without reverting or adjusting part of that all the info is gone.
I have a patch which so far makes p b work (if a non-DECL_EXTERNAL variable is
optimized away and had an initializer, it means nothing is actually changing it
and so we can add DW_AT_const_value attribute), plans how to do some other vars
in this testcase.



More information about the Gcc-bugs mailing list