Description of problem: DW_AT_const_value is unnecessary duplicated. Version-Release number of selected component (if applicable): GNU C 4.4.1 20091001 (Red Hat 4.4.1-18) How reproducible: Always Steps to Reproduce: 1. cat const.c struct foo { const int i; const long j; }; typedef struct foo fooer; static int bar (const int i, const long j) { return i * j; } static int func (int (*f) ()) { const fooer baz = { .i = 2, .j = 21 }; return f(baz.i, baz.j); } int main (int argc, char *argv[], char *envp[]) { return func (&bar) - 42; } 2. gcc -g -O2 -o const const.c 3. readelf --debug-dump=info const Actual results: <2><8b>: Abbrev Number: 10 (DW_TAG_variable) <8c> DW_AT_name : baz <90> DW_AT_decl_file : 1 <91> DW_AT_decl_line : 18 <92> DW_AT_type : <0xb9> <96> DW_AT_const_value : 16 byte block: 2 0 0 0 0 0 0 0 15 0 0 0 0 0 0 0 [...] <4><17c>: Abbrev Number: 21 (DW_TAG_variable) <17d> DW_AT_abstract_origin: <0x8b> <181> DW_AT_const_value : 16 byte block: 2 0 0 0 0 0 0 0 15 0 0 0 0 0 0 0 Expected results: Not having the DW_AT_const_value in the instance when the value is already in the abstract_origin.
Fixed in gcc-4.4.1-20.fc12.