From cc459ab40ad75779ba111199bd75437399251cc3 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Thu, 20 Sep 2007 23:27:39 +0200 Subject: re PR debug/33316 (ICE on valid variable-length automatic array in const struct) PR debug/33316 * dwarf2out.c (modified_type_die): Handle TYPE_DECL with NULL DECL_NAME. * dbxout.c (dbxout_type): Likewise. * gcc.dg/debug/pr33316.c: New test. From-SVN: r128631 --- gcc/dbxout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/dbxout.c') diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 2494eda..ad1b3c7 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -2029,7 +2029,11 @@ dbxout_type (tree type, int full) another type's definition; instead, output an xref and let the definition come when the name is defined. */ stabstr_S ((TREE_CODE (type) == RECORD_TYPE) ? "xs" : "xu"); - if (TYPE_NAME (type) != 0) + if (TYPE_NAME (type) != 0 + /* The C frontend creates for anonymous variable length + records/unions TYPE_NAME with DECL_NAME NULL. */ + && (TREE_CODE (TYPE_NAME (type)) != TYPE_DECL + || DECL_NAME (TYPE_NAME (type)))) dbxout_type_name (type); else { -- cgit v1.1