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

            Bug ID: 58123
           Summary: [4.8 Regression] debug line not tracked for last
                    autovariable dtor
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jan.kratochvil at redhat dot com
            Target: x86_64-unknown-linux-gnu

PASS: g++ (GCC) 4.7.3 20130221 (prerelease)
 - it did not generate separate line info for destructors at all
FAIL: g++ (GCC) 4.8.2 20130811 (prerelease)
FAIL: g++ (GCC) 4.9.0 20130811 (experimental)

class C {
public:
  C() {}
  ~C() {}
  int m() { return 0; }
};
/*  7 */ int main() {
/*  8 */   C a;
/*  9 */   C b;
/* 10 */   C c;
/* 11 */   return a.m() + b.m() + c.m();
/* 12 */ }

----------------------------------------------------------------------------
g++-4.7:
(gdb) start
8    /*  8 */   C a;
(gdb) next
9    /*  9 */   C b;
(gdb) next
10    /* 10 */   C c;
(gdb) next
11    /* 11 */   return a.m() + b.m() + c.m();
(gdb) next
12    /* 12 */ }
----------------------------------------------------------------------------
g++-4.8: each destructor has its own .debug_line entry:
(gdb) start
8    /*  8 */   C a;
(gdb) next
9    /*  9 */   C b;
(gdb) next
10    /* 10 */   C c;
(gdb) next
11    /* 11 */   return a.m() + b.m() + c.m();
(gdb) next
10    /* 10 */   C c;
(gdb) next
9    /*  9 */   C b;
(gdb) next
################## Missing: /*  8 */   C a;
11    /* 11 */   return a.m() + b.m() + c.m();
(gdb) next
12    /* 12 */ }
except for the last one:
/home/jkratoch/t/example2.C:10
  4005f7:       48 8d 45 ed             lea    -0x13(%rbp),%rax
  4005fb:       48 89 c7                mov    %rax,%rdi
  4005fe:       e8 2b 00 00 00          callq  40062e <C::~C()>
/home/jkratoch/t/example2.C:9
  400603:       48 8d 45 ee             lea    -0x12(%rbp),%rax
  400607:       48 89 c7                mov    %rax,%rdi
  40060a:       e8 1f 00 00 00          callq  40062e <C::~C()>
/home/jkratoch/t/example2.C:11
############################^^ here should be :8
  40060f:       48 8d 45 ef             lea    -0x11(%rbp),%rax
  400613:       48 89 c7                mov    %rax,%rdi
  400616:       e8 13 00 00 00          callq  40062e <C::~C()>
############################ Missing debug line for :11 or :12 here:
  40061b:       89 d8                   mov    %ebx,%eax
/home/jkratoch/t/example2.C:12
  40061d:       48 83 c4 18             add    $0x18,%rsp
  400621:       5b                      pop    %rbx
  400622:       5d                      pop    %rbp
  400623:       c3                      retq   

Downstream user bugreport: https://bugzilla.redhat.com/show_bug.cgi?id=995804

Reply via email to