* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
@ 2020-08-04 21:09 ` jan.kratochvil at redhat dot com
2020-08-04 21:10 ` jan.kratochvil at redhat dot com
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jan.kratochvil at redhat dot com @ 2020-08-04 21:09 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
Jan Kratochvil <jan.kratochvil at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jan.kratochvil at redhat dot com
--- Comment #1 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
Created attachment 48996
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48996&action=edit
.tar.xz reproducer for: fortran
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
2020-08-04 21:09 ` [Bug debug/96471] " jan.kratochvil at redhat dot com
@ 2020-08-04 21:10 ` jan.kratochvil at redhat dot com
2020-08-05 7:44 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jan.kratochvil at redhat dot com @ 2020-08-04 21:10 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
--- Comment #2 from Jan Kratochvil <jan.kratochvil at redhat dot com> ---
Created attachment 48997
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48997&action=edit
.tar.xz reproducer for: gnat
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
2020-08-04 21:09 ` [Bug debug/96471] " jan.kratochvil at redhat dot com
2020-08-04 21:10 ` jan.kratochvil at redhat dot com
@ 2020-08-05 7:44 ` rguenth at gcc dot gnu.org
2020-08-05 7:47 ` rguenth at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-05 7:44 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
Keywords| |ice-on-valid-code
CC| |rguenth at gcc dot gnu.org
Last reconfirmed| |2020-08-05
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
` (2 preceding siblings ...)
2020-08-05 7:44 ` rguenth at gcc dot gnu.org
@ 2020-08-05 7:47 ` rguenth at gcc dot gnu.org
2020-08-05 7:59 ` rguenth at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-05 7:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 49002
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49002&action=edit
reduced fortran testcase
Manually reduced the fortran testcase down to a single file, now reproduces
with
> ./f951 -quiet 1.F -O -g -fopenmp -fdebug-types-section
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
` (3 preceding siblings ...)
2020-08-05 7:47 ` rguenth at gcc dot gnu.org
@ 2020-08-05 7:59 ` rguenth at gcc dot gnu.org
2020-08-06 10:11 ` rguenth at gcc dot gnu.org
2020-08-06 10:15 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-05 7:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
And auto reduce + some manual sanitizing:
SUBROUTINE CMUMPS_SCATTER_DIST_RHS(
& POSINRHSCOMP_FWD, IFIRSTNOTTOUCHED,
& NBRECORDS)
INTEGER, INTENT(IN) :: POSINRHSCOMP_FWD(N)
CALL CMUMPS_DR_ASSEMBLE_LOCAL()
CONTAINS
SUBROUTINE CMUMPS_DR_ASSEMBLE_LOCAL()
!$OMP PARALLEL DO PRIVATE(I, IRHSCOMP, Iglob)
DO I = IFIRSTNOTTOUCHED, NBRECORDS
IRHSCOMP = POSINRHSCOMP_FWD(I)
ENDDO
END SUBROUTINE CMUMPS_DR_ASSEMBLE_LOCAL
END SUBROUTINE CMUMPS_SCATTER_DIST_RHS
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
` (4 preceding siblings ...)
2020-08-05 7:59 ` rguenth at gcc dot gnu.org
@ 2020-08-06 10:11 ` rguenth at gcc dot gnu.org
2020-08-06 10:15 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-06 10:11 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
So the DIEs in question are
DIE 0: DW_TAG_subrange_type (0x7ffff69f3e10)
abbrev id: 0 offset: 0 mark: 1
DW_AT_type: die -> 0 (0x7ffff69f3eb0)
DW_AT_upper_bound: die -> 0 (0x7ffff69f30f0)
refering to
DIE 0: DW_TAG_variable (0x7ffff69f30f0)
abbrev id: 0 offset: 0 mark: 0
DW_AT_type: die -> 0 (0x7ffff69d1d70)
DW_AT_artificial: 1
where the subrange type is part of a type unit.
I think type units do not work this way and a type die like this should
disqualify the whole thing from becoming externalized into a type unit in the
first place? There is should_move_die_to_comdat which already excludes
DIEs containing subprogram definitions, shouldn't all references to
non-type non-declaration DIEs also prevent a DIE from being externalized?
So for the specific case that's too early(?), after comdat breakout we still
see
DIE 0: DW_TAG_array_type (0x7ffff69f8140)
abbrev id: 0 offset: 0 mark: 0
DW_AT_type: die -> 0 (0x7ffff69f8000)
DIE 0: DW_TAG_subrange_type (0x7ffff69f8190)
abbrev id: 0 offset: 0 mark: 0
DW_AT_type: die -> 0 (0x7ffff69f8050)
DW_AT_upper_bound: location descriptor:
(0x7ffff69d1eb0) DW_OP_GNU_variable_value die -> 0
(0x7ffff69f30f0), 0
but then resolve_addr this into a direct DIE ref which eventually
copy_decls_walk would handle. There's also note_variable_value
doing some location frobbing from decls to DIEs which is done after
comdat breakout and which would expose more such situations, so
re-ordering that would make sense. Note I think
that even location lists are unwanted in type units. Unfortunately
the DWARF standard doesn't list what is and what is not allowed in type
units. Eventually one could strip the type unit off those unsupported
constructs and instead "complete" them in the main unit somehow.
Since resolve_addr runs only at dwarf2out_finish time we need to look
at the location case either disqualifying stuff or doing magic in
copy_decls_for_unworthy_types.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug debug/96471] ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section
2020-08-04 21:08 [Bug debug/96471] New: ICE: fortran+gnat: build_abbrev_table, at dwarf2out.c: -g -fdebug-types-section jan.kratochvil at redhat dot com
` (5 preceding siblings ...)
2020-08-06 10:11 ` rguenth at gcc dot gnu.org
@ 2020-08-06 10:15 ` rguenth at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2020-08-06 10:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96471
--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Created attachment 49008
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49008&action=edit
hackish patch
The following implements this (just the very special case of a single location
expression with a direct DIE ref). It also re-orders note_variable_value
which might be an obvious part.
Now the question is whether such a type unit makes sense:
<0><17>: Abbrev Number: 1 (DW_TAG_type_unit)
<18> DW_AT_language : 14 (Fortran 95)
<19> DW_AT_stmt_list : 0x0
<1><1d>: Abbrev Number: 2 (DW_TAG_structure_type)
<1e> DW_AT_name : (indirect string, offset: 0x1d0):
FRAME.cmumps_sc
atter_dist_rhs
<22> DW_AT_byte_size : 32
<23> DW_AT_sibling : <0x58>
<2><27>: Abbrev Number: 3 (DW_TAG_member)
<28> DW_AT_name : (indirect string, offset: 0x1b6):
posinrhscomp_fw
d
<2c> DW_AT_decl_file : 1
<2d> DW_AT_decl_line : 1
<2e> DW_AT_type : <0x58>
<32> DW_AT_data_member_location: 0
...
<1><58>: Abbrev Number: 4 (DW_TAG_restrict_type)
<59> DW_AT_type : <0x64>
...
<1><64>: Abbrev Number: 6 (DW_TAG_pointer_type)
<65> DW_AT_byte_size : 8
<66> DW_AT_type : <0x70>
...
<1><70>: Abbrev Number: 8 (DW_TAG_array_type)
<71> DW_AT_type : <0x83>
<75> DW_AT_sibling : <0x83>
<2><79>: Abbrev Number: 9 (DW_TAG_subrange_type)
<7a> DW_AT_type : <0x8a>
<7e> DW_AT_upper_bound : <0x9a>
...
<1><91>: Abbrev Number: 11 (DW_TAG_subprogram)
<92> DW_AT_external : 1
<92> DW_AT_name : (indirect string, offset: 0x1e):
cmumps_scatter_dist_rhs
<96> DW_AT_linkage_name: (indirect string, offset: 0x5c):
cmumps_scatter_dist_rhs_
<9a> DW_AT_declaration : 1
<2><9a>: Abbrev Number: 12 (DW_TAG_variable)
<9b> DW_AT_type : <0x8a>
<9f> DW_AT_artificial : 1
^ permalink raw reply [flat|nested] 8+ messages in thread