[Bug debug/69755] New: Bad debug location with DW_OP_GNU_convert <0x0>
nikolay.piskun at roguewave dot com
gcc-bugzilla@gcc.gnu.org
Wed Feb 10 19:43:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69755
Bug ID: 69755
Summary: Bad debug location with DW_OP_GNU_convert <0x0>
Product: gcc
Version: 5.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: debug
Assignee: unassigned at gcc dot gnu.org
Reporter: nikolay.piskun at roguewave dot com
Target Milestone: ---
I compiled simple C++11 optimized program and get following location:
00000014 00000000004004c9 00000000004004d7 (DW_OP_addr: 601038;
DW_OP_GNU_deref_type: 4 <0x30>; DW_OP_GNU_convert <0x29>; DW_OP_GNU_convert
<0x0>; DW_OP_breg0 (rax): 0; DW_OP_plus; DW_OP_stack_value)
The value of variable 'r' in debugger is clearly wrong. I think starting from
DW_OP_GNU_convert <0x0>; everything is wrong.
I will attach sample program compiled with gcc 5.3.1 as :
*** Compiling ../../src/tx_c++11_unnamed_type.cxx ***
/usr/bin/g++ -MD -MP -O3 -g -std=c++11 -std=c++11
-c ../../src/tx_c++11_unnamed_type.cxx -o tx_c++11_unnamed_type.o
*** Linking program tx_c++11_unnamed_type ***
/usr/bin/g++ -O3 -g -Wl,-disable-new-dtags -std=c++11 -std=c++11
tx_c++11_unnamed_type.o tx_c++11_unnamed_type1.o \
-o tx_c++11_unnamed_type
cat ../../src/tx_c++11_unnamed_type.hxx
template <class T>
class X_t {
T t;
public:
X_t() {t.x=25; t.y=1.1; }
int func()
{
return (int) t.x;
}
}; // class template
int func1();
cat ../../src/tx_c++11_unnamed_type.cxx
#include "tx_c++11_unnamed_type.hxx"
typedef struct {float x,y;} B; // type alias to an unnamed type
X_t<B> x2; // OK, 'B' names a type
static int func2()
{
return x2.func();
}
int main(){
int r = 0;
r += func1();
r += func2();
return r;
}
More information about the Gcc-bugs
mailing list