debug/111080 - avoid outputting debug info for unused restrict qualified type
commitbd2c4d6d8fffd5a6dae5217d6076cc4190bab13d
authorRichard Biener <rguenther@suse.de>
Mon, 21 Aug 2023 08:34:30 +0000 (21 10:34 +0200)
committerRichard Biener <rguenther@suse.de>
Thu, 24 Aug 2023 06:22:05 +0000 (24 08:22 +0200)
tree7b83f095ea0b81d2eec4dc7a677814261db2dcf9
parent0a888650303750fd72878fc083dfb30b62e30809
debug/111080 - avoid outputting debug info for unused restrict qualified type

The following applies some maintainance with respect to type qualifiers
and kinds added by later DWARF standards to prune_unused_types_walk.
The particular case in the bug is not handling (thus marking required)
all restrict qualified type DIEs.  I've found more DW_TAG_*_type that
are unhandled, looked up the DWARF docs and added them as well based
on common sense.

PR debug/111080
* dwarf2out.cc (prune_unused_types_walk): Handle
DW_TAG_restrict_type, DW_TAG_shared_type, DW_TAG_atomic_type,
DW_TAG_immutable_type, DW_TAG_coarray_type, DW_TAG_unspecified_type
and DW_TAG_dynamic_type as to only output them when referenced.

* gcc.dg/debug/dwarf2/pr111080.c: New testcase.
gcc/dwarf2out.cc
gcc/testsuite/gcc.dg/debug/dwarf2/pr111080.c [new file with mode: 0644]