This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug debug/45973] New: NRVO gives incorrect location
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 11 Oct 2010 22:00:17 +0000
- Subject: [Bug debug/45973] New: NRVO gives incorrect location
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45973
Summary: NRVO gives incorrect location
Product: gcc
Version: 4.6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: tromey@gcc.gnu.org
This test case comes from gdb bugzilla.
class foo
{
public:
int bar;
~foo(){};
};
foo f()
{
foo x;
x.bar = 1;
x.bar = x.bar;
return x;
};
int main()
{
f();
};
Compile with -g. Then, look at 'x' in the DWARF. I see:
<3><cf>: Abbrev Number: 15 (DW_TAG_variable)
<d0> DW_AT_name : x
<d2> DW_AT_decl_file : 1
<d3> DW_AT_decl_line : 10
<d4> DW_AT_type : <0x29>
<d8> DW_AT_location : 1 byte block: 52 (DW_OP_reg2)
I think this is missing a DW_OP_deref.
That is, I think reg2 points to the object, it doesn't hold the object.