This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: fix PR debug/11325
- From: Rainer Orth <ro at TechFak dot Uni-Bielefeld dot DE>
- To: scott snyder <snyder at fnal dot gov>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 18 Nov 2003 00:58:53 +0100
- Subject: Re: PATCH: fix PR debug/11325
- References: <200311141823.hAEINspm33092646@d0mino.fnal.gov>
Scott,
> If we encounter an incomplete definition of a type when marking the
> DIEs we want to keep in the debug output, we should also mark
> the complete definition if it exists.
>
> Bootstrapped and tested on linux/ia86.
>
> 2003-11-14 Scott Snyder <snyder@fnal.gov>
>
> PR debug/11325
> * dwarf2out.c (struct die_struct): Add die_definition field.
> (add_AT_specification): New.
> (gen_subprogram_die, gen_variable_die,
> gen_struct_or_union_type_die): Use it.
> (prune_unused_types_mark): If we're marking a forward declaration,
> also mark the full definition, if it exists.
this patch broke bootstrap on mips-sgi-irix6.5:
$ ./xgcc -B./ -B/vol/gcc/share/mips-sgi-irix6.5/bin/ -isystem /vol/gcc/share/mips-sgi-irix6.5/include -isystem /vol/gcc/share/mips-sgi-irix6.5/sys-include -L/vol/gcc/obj/gcc-3.4-20031117/6.5-gcc-java/gcc/../ld -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -isystem ./include -Wno-error -g -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -I. -I -I/vol/gnu/src/gcc/gcc-dist/gcc -I/vol/gnu/src/gcc/gcc-dist/gcc/ -I/vol/gnu/src/gcc/gcc-dist/gcc/../include -DL_ffssi2 -c /vol/gnu/src/gcc/gcc-dist/gcc/libgcc2.c -o libgcc/./_ffssi2.o
/vol/gnu/src/gcc/gcc-dist/gcc/libgcc2.c:434: internal compiler error: in AT_flag, at dwarf2out.c:4480
I can reproduce this with
$ ./cc1 libgcc2.i -g
__ffssi2
/vol/gnu/src/gcc/gcc-dist/gcc/libgcc2.c:434: internal compiler error: in AT_flag, at dwarf2out.c:4480
where libgcc2.i is the output from -save-temps.
Running cc1 under gdb, I find this stack trace:
#0 fancy_abort (file=0x1066e070 "/.vol/gcc/src/gcc/gcc/dwarf2out.c",
line=4480, function=0x106710f0 "AT_flag")
at /.vol/gcc/src/gcc/gcc/diagnostic.c:584
#1 0x10394eb8 in AT_flag (a=0x417efc0)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:4480
#2 0x103abb24 in get_AT_flag (die=0x4176bb0, attr_kind=DW_AT_declaration)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:4925
#3 0x103b3a08 in prune_unused_types_mark (die=0x4176bb0, dokids=1)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12524
#4 0x103b38f4 in prune_unused_types_walk_attribs (die=0x4176c40)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12489
#5 0x103b39f0 in prune_unused_types_mark (die=0x4176c40, dokids=1)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12520
#6 0x103b38f4 in prune_unused_types_walk_attribs (die=0x4176c10)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12489
#7 0x103b3ba8 in prune_unused_types_walk (die=0x4176c10)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12590
#8 0x103b3bd4 in prune_unused_types_walk (die=0x40ac900)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12594
#9 0x103b3db4 in prune_unused_types ()
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12642
#10 0x103b45d8 in dwarf2out_finish (filename=0x1075c960 "libgcc2.i")
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:12755
#11 0x10166d20 in compile_file () at /.vol/gcc/src/gcc/gcc/toplev.c:1874
#12 0x1016eb38 in do_compile () at /.vol/gcc/src/gcc/gcc/toplev.c:4695
#13 0x1016ec5c in toplev_main (argc=3, argv=0x7ffb7f44)
at /.vol/gcc/src/gcc/gcc/toplev.c:4735
#14 0x1011fa24 in main (argc=3, argv=0x7ffb7f44)
at /.vol/gcc/src/gcc/gcc/main.c:35
(gdb) up
#1 0x10394eb8 in AT_flag (a=0x417efc0)
at /.vol/gcc/src/gcc/gcc/dwarf2out.c:4480
(gdb) p a
$1 = 0x417efc0
(gdb) call AT_class (a)
$2 = dw_val_class_unsigned_const
(gdb) p *a
$4 = {dw_attr = DW_AT_declaration, dw_attr_next = 0x417f000, dw_attr_val = {
val_class = dw_val_class_unsigned_const, v = {val_addr = 0x0,
val_offset = 1, val_loc_list = 0x0, val_loc = 0x0, val_int = 1,
val_unsigned = 1, val_long_long = {hi = 0, low = 1}, val_float = {
array = 0x0, length = 1}, val_die_ref = {die = 0x0, external = 1},
val_fde_index = 0, val_str = 0x0, val_lbl_id = 0x0, val_flag = 0 '\0'}}}
Reverting the patch allows the bootstrap to continue.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University