From: Tom Tromey Date: Thu, 29 Aug 2024 19:23:18 +0000 (-0600) Subject: Check DECL_NAMELESS in modified_type_die X-Git-Tag: basepoints/gcc-16~6095 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5326306e7d9d36eccc2c2f02e1357818625f057b;p=thirdparty%2Fgcc.git Check DECL_NAMELESS in modified_type_die While working on a patch to the Ada compiler, I found a spot in dwarf2out.cc that calls add_name_attribute without respecting DECL_NAMELESS. gcc * dwarf2out.cc (modified_type_die): Check DECL_NAMELESS. --- diff --git a/gcc/dwarf2out.cc b/gcc/dwarf2out.cc index 89c2fd02649..a7ec359bd0c 100644 --- a/gcc/dwarf2out.cc +++ b/gcc/dwarf2out.cc @@ -14019,6 +14019,7 @@ modified_type_die (tree type, int cv_quals, bool reverse, || (cv_quals == TYPE_UNQUALIFIED))) || (TREE_CODE (name) == TYPE_DECL && DECL_NAME (name) + && !DECL_NAMELESS (name) && (TREE_TYPE (name) == qualified_type || (lang_hooks.types.get_debug_type && (lang_hooks.types.get_debug_type (TREE_TYPE (name))