aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-10-05 21:52:20 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2009-10-05 21:52:20 +0200
commit4a24ddb979d2c087f4c354199dab8bb826d59a45 (patch)
treed290fe5bc37e0b44a202704116d6a9f20eb170b6
parent7555009aa9f076bf73814094beb5bdbd6982db54 (diff)
downloadgcc-4a24ddb979d2c087f4c354199dab8bb826d59a45.zip
gcc-4a24ddb979d2c087f4c354199dab8bb826d59a45.tar.gz
gcc-4a24ddb979d2c087f4c354199dab8bb826d59a45.tar.bz2
dwarf2out.c (modified_type_die): Don't add DW_AT_name to DW_TAG_{const,volatile}_type if...
* dwarf2out.c (modified_type_die): Don't add DW_AT_name to DW_TAG_{const,volatile}_type if its DW_AT_type already has the same name and isn't the main variant. From-SVN: r152468
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/dwarf2out.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index d4b7a7f..4c6dbef 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
2009-10-05 Jakub Jelinek <jakub@redhat.com>
+ * dwarf2out.c (modified_type_die): Don't add DW_AT_name to
+ DW_TAG_{const,volatile}_type if its DW_AT_type already has the
+ same name and isn't the main variant.
+
PR debug/41558
* dwarf2out.c (loc_by_reference): Removed.
(dw_loc_list_1): New function.
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index b92f69c..f9304e5 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -11971,10 +11971,16 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
/* Builtin types don't have a DECL_ORIGINAL_TYPE. For those,
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. */
+ user's program; just attach a DW_AT_name to the type.
+ Don't attach a DW_AT_name to DW_TAG_const_type or DW_TAG_volatile_type
+ if the base type already has the same name. */
if (name
- && (TREE_CODE (name) != TYPE_DECL
- || (TREE_TYPE (name) == qualified_type && DECL_NAME (name))))
+ && ((TREE_CODE (name) != TYPE_DECL
+ && (qualified_type == TYPE_MAIN_VARIANT (type)
+ || (!is_const_type && !is_volatile_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,