From: Jakub Jelinek Date: Tue, 18 Apr 2017 16:58:48 +0000 (+0200) Subject: re PR debug/80263 (gcc's internal type "sizetype" leaks out as base type name in... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1cda61fc28d476c194db1c9f03676688d796ac4f;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fa3e2575ec1..38c0d301765 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-04-18 Jakub Jelinek + + PR debug/80263 + * dwarf2out.c (modified_type_die): Try harder not to emit internal + sizetype type into debug info. + 2017-04-18 Michael Meissner PR target/80099 diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index 89d18725c3a..27fb9f05193 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) { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 000f4717143..4157094c399 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-04-18 Jakub Jelinek + + PR debug/80263 + * gcc.dg/debug/dwarf2/pr80263.c: New test. + 2017-04-18 Michael Meissner PR target/80099 diff --git a/gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c b/gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c new file mode 100644 index 00000000000..57633b4f0eb --- /dev/null +++ b/gcc/testsuite/gcc.dg/debug/dwarf2/pr80263.c @@ -0,0 +1,7 @@ +/* PR debug/80263 */ +/* { dg-do compile } */ +/* { dg-options "-g -dA" } */ + +char array[1]; + +/* { dg-final { scan-assembler-not {\msizetype} } } */