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.
I think this is the same as PR 44731.
Thanks. I thought there was another bug for this, but I didn't find it. *** This bug has been marked as a duplicate of bug 44731 ***