@@ -1,3 +1,9 @@
+2014-07-09 Mark Wielaard <mjw@redhat.com>
+
+ PR debug/60782
+ * dwarf2out.c (modified_type_die): Handle TYPE_QUAL_ATOMIC.
+ * opts.c (common_handle_option): Accept -gdwarf-5.
+
2014-07-08 Mark Wielaard <mjw@redhat.com>
PR debug/59051
@@ -10478,7 +10478,8 @@ modified_type_die (tree type, int cv_quals, dw_die_ref context_die)
return NULL;
/* Only these cv-qualifiers are currently handled. */
- cv_quals &= (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT);
+ cv_quals &= (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT
+ | TYPE_QUAL_ATOMIC);
/* Don't emit DW_TAG_restrict_type for DWARFv2, since it is a type
tag modifier (and not an attribute) old consumers won't be able
@@ -10486,6 +10487,10 @@ modified_type_die (tree type, int cv_quals, dw_die_ref context_die)
if (dwarf_version < 3)
cv_quals &= ~TYPE_QUAL_RESTRICT;
+ /* Likewise for DW_TAG_atomic_type for DWARFv5. */
+ if (dwarf_version < 5)
+ cv_quals &= ~TYPE_QUAL_ATOMIC;
+
/* See if we already have the appropriately qualified variant of
this type. */
qualified_type = get_qualified_type (type, cv_quals);
@@ -10529,7 +10534,8 @@ modified_type_die (tree type, int cv_quals, dw_die_ref context_die)
else
{
int dquals = TYPE_QUALS_NO_ADDR_SPACE (dtype);
- dquals &= (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT);
+ dquals &= (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE | TYPE_QUAL_RESTRICT
+ | TYPE_QUAL_ATOMIC);
if ((dquals & ~cv_quals) != TYPE_UNQUALIFIED
|| (cv_quals == dquals && DECL_ORIGINAL_TYPE (name) != type))
/* cv-unqualified version of named type. Just use
@@ -10564,12 +10570,22 @@ modified_type_die (tree type, int cv_quals, dw_die_ref context_die)
sub_die = modified_type_die (type, cv_quals & ~TYPE_QUAL_VOLATILE,
context_die);
}
- else if (cv_quals & TYPE_QUAL_RESTRICT)
+ else if ((cv_quals & TYPE_QUAL_RESTRICT)
+ && (((cv_quals & ~TYPE_QUAL_RESTRICT) == TYPE_UNQUALIFIED)
+ || get_qualified_type (type, cv_quals) == NULL_TREE
+ || (get_qualified_type (type, cv_quals & ~TYPE_QUAL_RESTRICT)
+ != NULL_TREE)))
{
mod_type_die = new_die (DW_TAG_restrict_type, mod_scope, type);
sub_die = modified_type_die (type, cv_quals & ~TYPE_QUAL_RESTRICT,
context_die);
}
+ else if (cv_quals & TYPE_QUAL_ATOMIC)
+ {
+ mod_type_die = new_die (DW_TAG_atomic_type, mod_scope, type);
+ sub_die = modified_type_die (type, cv_quals & ~TYPE_QUAL_ATOMIC,
+ context_die);
+ }
else if (code == POINTER_TYPE)
{
mod_type_die = new_die (DW_TAG_pointer_type, mod_scope, type);
@@ -1884,7 +1884,7 @@ common_handle_option (struct gcc_options *opts,
/* FALLTHRU */
case OPT_gdwarf_:
- if (value < 2 || value > 4)
+ if (value < 2 || value > 5)
error_at (loc, "dwarf version %d is not supported", value);
else
opts->x_dwarf_version = value;
@@ -1,3 +1,8 @@
+2014-07-09 Mark Wielaard <mjw@redhat.com>
+
+ PR debug/60782
+ * gcc.dg/guality/atomic.c: New test.
+
2014-07-08 Mark Wielaard <mjw@redhat.com>
PR debug/59051
new file mode 100644
@@ -0,0 +1,13 @@
+/* debuginfo tests for the _Atomic type qualifier. */
+/* { dg-do run } */
+/* { dg-options "-std=c11 -gdwarf-5" } */
+
+volatile _Atomic int * const _Atomic hwaddr = (void *) 0x1234;
+
+int
+main (int argc, char **argv)
+{
+ return hwaddr == (void *) argv[0];
+}
+
+/* { dg-final { gdb-test 10 "type:hwaddr" "volatile _Atomic int * const _Atomic" } } */
@@ -1,3 +1,8 @@
+2014-07-09 Mark Wielaard <mjw@redhat.com>
+
+ PR debug/60782
+ * dwarf2.def: Add DWARFv5 DW_TAG_atomic_type.
+
2014-06-10 Thomas Schwinge <thomas@codesourcery.com>
PR lto/61334
@@ -133,6 +133,8 @@ DW_TAG (DW_TAG_shared_type, 0x40)
DW_TAG (DW_TAG_type_unit, 0x41)
DW_TAG (DW_TAG_rvalue_reference_type, 0x42)
DW_TAG (DW_TAG_template_alias, 0x43)
+/* DWARF 5. */
+DW_TAG (DW_TAG_atomic_type, 0x47) /* NOT AN OFFICIAL NUMBER. DWARF5 131112.1 */
DW_TAG_DUP (DW_TAG_lo_user, 0x4080)
DW_TAG_DUP (DW_TAG_hi_user, 0xffff)