diff options
author | Jakub Jelinek <jakub@redhat.com> | 2017-04-18 18:58:48 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2017-04-18 18:58:48 +0200 |
commit | 1cda61fc28d476c194db1c9f03676688d796ac4f (patch) | |
tree | 7d7c30c08618b11ab4c161ae199435cc50039333 /gcc/dwarf2out.c | |
parent | 19970253373d37faecea458bd9f511c9cb3ed6e7 (diff) | |
download | gcc-1cda61fc28d476c194db1c9f03676688d796ac4f.zip gcc-1cda61fc28d476c194db1c9f03676688d796ac4f.tar.gz gcc-1cda61fc28d476c194db1c9f03676688d796ac4f.tar.bz2 |
re PR debug/80263 (gcc's internal type "sizetype" leaks out as base type name in the DWARF info)
PR debug/80263
* dwarf2out.c (modified_type_die): Try harder not to emit internal
sizetype type into debug info.
* gcc.dg/debug/dwarf2/pr80263.c: New test.
From-SVN: r246973
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 89d1872..27fb9f0 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -12464,20 +12464,29 @@ modified_type_die (tree type, int cv_quals, bool reverse, this type. */ qualified_type = get_qualified_type (type, cv_quals); - if (qualified_type == sizetype - && TYPE_NAME (qualified_type) - && TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL) + if (qualified_type == sizetype) { - tree t = TREE_TYPE (TYPE_NAME (qualified_type)); + /* Try not to expose the internal sizetype type's name. */ + if (TYPE_NAME (qualified_type) + && TREE_CODE (TYPE_NAME (qualified_type)) == TYPE_DECL) + { + tree t = TREE_TYPE (TYPE_NAME (qualified_type)); - gcc_checking_assert (TREE_CODE (t) == INTEGER_TYPE - && TYPE_PRECISION (t) - == TYPE_PRECISION (qualified_type) - && TYPE_UNSIGNED (t) - == TYPE_UNSIGNED (qualified_type)); - qualified_type = t; + gcc_checking_assert (TREE_CODE (t) == INTEGER_TYPE + && (TYPE_PRECISION (t) + == TYPE_PRECISION (qualified_type)) + && (TYPE_UNSIGNED (t) + == TYPE_UNSIGNED (qualified_type))); + qualified_type = t; + } + else if (qualified_type == sizetype + && TREE_CODE (sizetype) == TREE_CODE (size_type_node) + && TYPE_PRECISION (sizetype) == TYPE_PRECISION (size_type_node) + && TYPE_UNSIGNED (sizetype) == TYPE_UNSIGNED (size_type_node)) + qualified_type = size_type_node; } + /* If we do, then we can just use its DIE, if it exists. */ if (qualified_type) { |