I used this source, from PR 55608: static const char *a = "opq"; static const char b[8] = "rstuv"; static const char *c = b; static const char *d = b + 3; static const int e[] = { 1, 2, 3, 4 }; static int f[] = { 5, 6, 7 }; static const int *g = e; static const int *h = e + 2; static const int *i = f; static const int *j = f + 2; int main () { const char *p = "abcd"; const char *q = "efgh"; const char r[] = "ijk\0lmn"; const char *s = r; const char *t = b; const int *u = e; const int *v = e + 2; const int *w = f; const int *x = f + 2; return 0; } I compiled this with "gcc -g -O2", using git master gcc from yesterday. The DWARF contains some needless duplication: <1><fd>: Abbrev Number: 7 (DW_TAG_const_type) <fe> DW_AT_type : <0xe6> <1><12f>: Abbrev Number: 7 (DW_TAG_const_type) <130> DW_AT_type : <0xe6>
Replicated with gcc (GCC) 4.9.0 20140219 (experimental) [ d7] array_type type (ref4) [ d0] [ ee] const_type type (ref4) [ d7] [ 124] const_type type (ref4) [ d7] DIE ee is referenced from: [ 66] variable name (string) "r" decl_file (data1) 1 decl_line (data1) 17 type (ref4) [ ee] location (exprloc) [ 0] fbreg -96 That is const char r[] = "ijk\0lmn"; in main (). DIE 124 is referenced from: [ 111] variable name (string) "b" decl_file (data1) 1 decl_line (data1) 2 type (ref4) [ 124] location (exprloc) [ 0] addr 0x400644 <b> That is the global static const char b[8] = "rstuv"; Do those 2 really represent the same type?