2007-09-20 Jakub Jelinek <jakub@redhat.com>
+ PR debug/33316
+ * dwarf2out.c (modified_type_die): Handle TYPE_DECL with NULL
+ DECL_NAME.
+ * dbxout.c (dbxout_type): Likewise.
+
PR c/33238
PR c/27301
* gimplify.c (gimplify_vla_decl): New function.
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
{
don't output a DW_TAG_typedef, since there isn't one in the
user's program; just attach a DW_AT_name to the type. */
if (name
- && (TREE_CODE (name) != TYPE_DECL || TREE_TYPE (name) == qualified_type))
+ && (TREE_CODE (name) != TYPE_DECL
+ || (TREE_TYPE (name) == qualified_type && DECL_NAME (name))))
{
if (TREE_CODE (name) == TYPE_DECL)
/* Could just call add_name_and_src_coords_attributes here,
2007-09-20 Jakub Jelinek <jakub@redhat.com>
+ PR debug/33316
+ * gcc.dg/debug/pr33316.c: New test.
+
PR c++/33496
* g++.dg/cpp0x/variadic76.C: New test.
* g++.dg/cpp0x/variadic77.C: New test.
--- /dev/null
+/* PR debug/33316 */
+
+int
+foo (void *x, int y)
+{
+ const struct { int d[y]; } *a = x;
+ return a[0].d[0];
+}
+
+int
+bar (void *x, int y)
+{
+ const struct S { int d[y]; } *a = x;
+ return a[0].d[0];
+}