http://gcc.gnu.org/bugzilla/show_bug.cgi?id=61116

            Bug ID: 61116
           Summary: redundant DWARF with VLAs
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tromey at gcc dot gnu.org

Compile this program with -g -O2:

void f(int n)
{
  struct s { int vla[n]; } sv;
  union u { int vla[n]; } uv;
}


Now examine the resulting DWARF.
I see redundant definitions of the array type:

 <1><a2>: Abbrev Number: 10 (DW_TAG_array_type)
    <a3>   DW_AT_type        : <0x9b>    
    <a7>   DW_AT_sibling     : <0xbc>    
 <2><ab>: Abbrev Number: 11 (DW_TAG_subrange_type)
    <ac>   DW_AT_type        : <0xbc>    
    <b0>   DW_AT_upper_bound : 10 byte block: 75 0 8 20 24 8 20 26 31 1c    
(DW_OP_breg5 (rdi): 0; DW_OP_const1u: 32; DW_OP_shl; DW_OP_const1u: 32;
DW_OP_shra; DW_OP_lit1; DW_OP_minus)

[...]

 <2><c8>: Abbrev Number: 11 (DW_TAG_subrange_type)
    <c9>   DW_AT_type        : <0xbc>    
    <cd>   DW_AT_upper_bound : 10 byte block: 75 0 8 20 24 8 20 26 31 1c    
(DW_OP_breg5 (rdi): 0; DW_OP_const1u: 32; DW_OP_shl; DW_OP_const1u: 32;
DW_OP_shra; DW_OP_lit1; DW_OP_minus)

Reply via email to