aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-05-12 14:08:34 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2010-05-12 14:08:34 +0200
commit7c2db0d3628062fc4fc9227c2e3ac4922b10f059 (patch)
tree7c2bbc9a530c0bc7329d73cce4d2900d40f8a5c3 /gcc
parent5e247ae5a1779cdd22af089f8666b3d7c5f4cecf (diff)
downloadgcc-7c2db0d3628062fc4fc9227c2e3ac4922b10f059.zip
gcc-7c2db0d3628062fc4fc9227c2e3ac4922b10f059.tar.gz
gcc-7c2db0d3628062fc4fc9227c2e3ac4922b10f059.tar.bz2
re PR debug/42278 (incorrect dwarf data gcc-4.4.2)
PR debug/42278 * dwarf2out.c (base_type_die): Don't add name attribute here. (modified_type_die): Instead of sizetype use its underlying original type. If a DW_TAG_base_type doesn't have name added, add __unknown__. (dwarf2out_imported_module_or_decl_1): Don't call base_type_die, always call force_type_die instead. From-SVN: r159315
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/dwarf2out.c27
2 files changed, 29 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b63cde5..fb4d616 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2010-05-12 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/42278
+ * dwarf2out.c (base_type_die): Don't add name attribute here.
+ (modified_type_die): Instead of sizetype use
+ its underlying original type. If a DW_TAG_base_type doesn't
+ have name added, add __unknown__.
+ (dwarf2out_imported_module_or_decl_1): Don't call base_type_die,
+ always call force_type_die instead.
+
2010-05-12 Maxim Kuvyrkov <maxim@codesourcery.com>
* targhooks.c (default_stack_protect_guard): Avoid sharing RTL
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index 66ac5eb..467bb26 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -12073,10 +12073,6 @@ base_type_die (tree type)
base_type_result = new_die (DW_TAG_base_type, comp_unit_die, type);
- /* This probably indicates a bug. */
- if (! TYPE_NAME (type))
- add_name_attribute (base_type_result, "__unknown__");
-
add_AT_unsigned (base_type_result, DW_AT_byte_size,
int_size_in_bytes (type));
add_AT_unsigned (base_type_result, DW_AT_encoding, encoding);
@@ -12195,6 +12191,21 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
((is_const_type ? TYPE_QUAL_CONST : 0)
| (is_volatile_type ? TYPE_QUAL_VOLATILE : 0)));
+ if (qualified_type == sizetype
+ && TYPE_NAME (qualified_type)
+ && TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL)
+ {
+#ifdef ENABLE_CHECKING
+ gcc_assert (TREE_CODE (TREE_TYPE (TYPE_NAME (qualified_type)))
+ == INTEGER_TYPE
+ && TYPE_PRECISION (TREE_TYPE (TYPE_NAME (qualified_type)))
+ == TYPE_PRECISION (qualified_type)
+ && TYPE_UNSIGNED (TREE_TYPE (TYPE_NAME (qualified_type)))
+ == TYPE_UNSIGNED (qualified_type));
+#endif
+ qualified_type = TREE_TYPE (TYPE_NAME (qualified_type));
+ }
+
/* If we do, then we can just use its DIE, if it exists. */
if (qualified_type)
{
@@ -12311,6 +12322,9 @@ modified_type_die (tree type, int is_const_type, int is_volatile_type,
name = DECL_NAME (name);
add_name_attribute (mod_type_die, IDENTIFIER_POINTER (name));
}
+ /* This probably indicates a bug. */
+ else if (mod_type_die->die_tag == DW_TAG_base_type)
+ add_name_attribute (mod_type_die, "__unknown__");
if (qualified_type)
equate_type_number_to_die (qualified_type, mod_type_die);
@@ -19816,10 +19830,7 @@ dwarf2out_imported_module_or_decl_1 (tree decl,
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == CONST_DECL)
{
- if (is_base_type (TREE_TYPE (decl)))
- at_import_die = base_type_die (TREE_TYPE (decl));
- else
- at_import_die = force_type_die (TREE_TYPE (decl));
+ at_import_die = force_type_die (TREE_TYPE (decl));
/* For namespace N { typedef void T; } using N::T; base_type_die
returns NULL, but DW_TAG_imported_declaration requires
the DW_AT_import tag. Force creation of DW_TAG_typedef. */