+2011-03-21 Richard Guenther <rguenther@suse.de>
+
+ PR c/47939
+ * c-decl.c (grokdeclarator): Drop to the main variant only
+ for array types. Drop flag_gen_aux_info check.
+
2011-03-21 Richard Guenther <rguenther@suse.de>
PR translation/47911
const char *errmsg;
tree expr_dummy;
bool expr_const_operands_dummy;
+ enum c_declarator_kind first_non_attr_kind;
if (TREE_CODE (type) == ERROR_MARK)
return error_mark_node;
{
const struct c_declarator *decl = declarator;
+ first_non_attr_kind = cdk_attrs;
while (decl)
switch (decl->kind)
{
case cdk_pointer:
funcdef_syntax = (decl->kind == cdk_function);
decl = decl->declarator;
+ if (first_non_attr_kind == cdk_attrs)
+ first_non_attr_kind = decl->kind;
break;
case cdk_attrs:
loc = decl->id_loc;
if (decl->u.id)
name = decl->u.id;
+ if (first_non_attr_kind == cdk_attrs)
+ first_non_attr_kind = decl->kind;
decl = 0;
break;
error_at (loc, "conflicting named address spaces (%s vs %s)",
c_addr_space_name (as1), c_addr_space_name (as2));
- if (!flag_gen_aux_info && (TYPE_QUALS (element_type)))
+ if ((TREE_CODE (type) == ARRAY_TYPE
+ || first_non_attr_kind == cdk_array)
+ && TYPE_QUALS (element_type))
type = TYPE_MAIN_VARIANT (type);
type_quals = ((constp ? TYPE_QUAL_CONST : 0)
| (restrictp ? TYPE_QUAL_RESTRICT : 0)
+2011-03-21 Richard Guenther <rguenther@suse.de>
+
+ PR c/47939
+ * gcc.dg/debug/dwarf2/pr47939-1.c: New testcase.
+ * gcc.dg/debug/dwarf2/pr47939-2.c: Likewise.
+ * gcc.dg/debug/dwarf2/pr47939-3.c: Likewise.
+ * gcc.dg/debug/dwarf2/pr47939-4.c: Likewise.
+
2011-03-21 Jakub Jelinek <jakub@redhat.com>
PR target/48213
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -dA" } */
+
+typedef struct _Harry { int dummy; } Harry_t;
+Harry_t harry;
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_name: \"Harry_t\"" } } */
+/* { dg-final { cleanup-saved-temps } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -dA" } */
+
+typedef const struct _Harry { int dummy; } Harry_t;
+Harry_t harry;
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_name: \"Harry_t\"" } } */
+/* { dg-final { cleanup-saved-temps } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -dA" } */
+
+typedef struct _Harry { int dummy; } Harry_t;
+const Harry_t harry[5];
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_name: \"Harry_t\"" } } */
+/* { dg-final { cleanup-saved-temps } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-save-temps -g -dA" } */
+
+typedef const struct _Harry { int dummy; } Harry_t;
+Harry_t harry[10];
+
+/* { dg-final { scan-assembler "DW_TAG_typedef\[^\\r\\n\]*\[\\r\\n\]+\[^\\r\\n\]*DW_AT_name: \"Harry_t\"" } } */
+/* { dg-final { cleanup-saved-temps } } */