This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix debug fallout of proposed PR68162 fix
- From: Richard Biener <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: jason at redhat dot com, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Wed, 18 Nov 2015 09:50:26 +0100 (CET)
- Subject: [PATCH] Fix debug fallout of proposed PR68162 fix
- Authentication-results: sourceware.org; auth=none
The following patch makes sure we still emit a DW_TAG_typedef for
the element typedef in gcc.dg/debug/dwarf2/pr47939-4.c after a change
to how the C frontend structures the variant chain of arrays.
It makes dwarf2out _not_ re-build the variant for arrays (like it
does for vectors).
Patch was tested by Joseph (also on gdb testsuite?) and I'm currently
re-testing on x86_64-unknown-linux-gnu.
Ok for trunk and GCC 5 branch?
Thanks,
Richard.
2015-11-18 Richard Biener <rguenther@suse.de>
PR c/68162
* dwarf2out.c (gen_type_die_with_usage): Keep variant types
of arrays.
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 230428)
+++ gcc/dwarf2out.c (working copy)
@@ -20784,9 +20784,10 @@ gen_type_die_with_usage (tree type, dw_d
/* We are going to output a DIE to represent the unqualified version
of this type (i.e. without any const or volatile qualifiers) so
get the main variant (i.e. the unqualified version) of this type
- now. (Vectors are special because the debugging info is in the
+ now. (Vectors and arrays are special because the debugging info is in the
cloned type itself). */
- if (TREE_CODE (type) != VECTOR_TYPE)
+ if (TREE_CODE (type) != VECTOR_TYPE
+ && TREE_CODE (type) != ARRAY_TYPE)
type = type_main_variant (type);
/* If this is an array type with hidden descriptor, handle it first. */