This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

New tree code anon_decl leads to abort of dwarf2out.c:gen_decl_die


A file from the gdb testsuite triggers an internal compiler error on sh-elf.
gen_decl_die does not know what to do with:

 <alias_decl 0x40194a10 z
    type <integer_type 0x4001c540 int asm_written type_6 SI
        size <integer_cst 0x40019560 constant 32>
        unit size <integer_cst 0x40019600 constant 4>
        align 32 symtab 1075211448 alias set -1 precision 32 min <integer_cst 0x400195c0 -2147483648> max <integer_cst 0x400195e0 2147483647>
        pointer_to_this <pointer_type 0x4014fcb0>>
    external VOID file ../../../srcw/gdb/testsuite/gdb.c++/anon-union.cc line 49
    align 1 context <function_decl 0x40190620 main> initial <component_ref 0x401933c0> chain <alias_decl 0x40194a80 w>>

Should we emit any debug information for this tree code, or just ignore it?

The ICE can be reproduced with the preprocessed file both for
i686-pc-linux-gnu X sh-elf and native i686-pc-linux-gnu just with
./cc1plus -g anon-union.ii  .  Here is the preprocessed file:

# 1 "../../../srcw/gdb/testsuite/gdb.c++/anon-union.cc"
# 1 "<built-in>"
# 1 "<command line>"
# 1 "../../../srcw/gdb/testsuite/gdb.c++/anon-union.cc"

struct Foo {
  union {
    int zero;
    unsigned int one;
  } num1;
  struct X {
      int rock;
      unsigned int rock2;
  };
  union {
    int pebble;
    X x;
    union {
      int qux;
      unsigned int mux;
    };
    unsigned int boulder;
  };
  union {
    int paper;
    unsigned int cloth;
  };
  union {
    int two;
    unsigned int three;
  } num2;
};

union Bar {
  int x;
  unsigned int y;
};


int main()
{
  Foo foo = {0, 0};

  foo.paper = 33;
  foo.pebble = 44;
  foo.mux = 55;

  Bar bar = {0};

  union {
    int z;
    unsigned int w;
  }; w = 0;

  bar.x = 33;

  w = 45;

}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]