re PR debug/40705 (ICE in gen_type_die_with_usage, at dwarf2out.c:15117)

2009-07-14  Dodji Seketeli  <dodji@redhat.com>

gcc/ChangeLog:
	PR debug/40705
	PR c++/403057
	* dwarf2.out.c (gen_type_die_with_usage): Added comment.

gcc/cp/ChangeLog:
	PR debug/40705
	PR c++/403057
	* decl2.c (grokfield): Don't call set_underlying_type on typedef
	decls that are type names.

gcc/testsuite/ChangeLog:
	PR debug/40705
	PR c++/403057
	* g++.dg/debug/dwarf2/typedef1.C: New test.
	* g++.dg/other/typedef3.C: Likewise.

From-SVN: r149628
This commit is contained in:
Dodji Seketeli 2009-07-14 15:01:55 +00:00 committed by Dodji Seketeli
parent 0b200b806d
commit 4fdaccea13
7 changed files with 71 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2009-07-14 Dodji Seketeli <dodji@redhat.com>
PR debug/40705
PR c++/403057
* dwarf2.out.c (gen_type_die_with_usage): Added comment.
2009-07-14 Richard Guenther <rguenther@suse.de>
PR middle-end/40745

View File

@ -1,3 +1,10 @@
2009-07-14 Dodji Seketeli <dodji@redhat.com>
PR debug/40705
PR c++/403057
* decl2.c (grokfield): Don't call set_underlying_type on typedef
decls that are type names.
2009-07-13 Andrew Pinski <andrew_pinski@playstation.sony.com>
PR C++/22154

View File

@ -821,7 +821,9 @@ grokfield (const cp_declarator *declarator,
cplus_decl_attributes (&value, attrlist, attrflags);
}
if (declspecs->specs[(int)ds_typedef])
if (declspecs->specs[(int)ds_typedef]
&& TREE_TYPE (value) != error_mark_node
&& TYPE_NAME (TYPE_MAIN_VARIANT (TREE_TYPE (value))) != value)
set_underlying_type (value);
return value;

View File

@ -15135,6 +15135,8 @@ gen_type_die_with_usage (tree type, dw_die_ref context_die,
if (type == NULL_TREE || type == error_mark_node)
return;
/* If TYPE is a typedef type variant, let's generate debug info
for the parent typedef which TYPE is a type of. */
if (TYPE_NAME (type) && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
&& DECL_ORIGINAL_TYPE (TYPE_NAME (type)))
{

View File

@ -1,3 +1,11 @@
2009-07-14 Dodji Seketeli <dodji@redhat.com>
PR debug/40705
* g++.dg/debug/dwarf2/typedef1.C: New test.
PR c++/403057
* g++.dg/other/typedef3.C: New test.
2009-07-14 Maxim Kuvyrkov <maxim@codesourcery.com>
* gcc.dg/20090709-1.c: Move to a proper place ...

View File

@ -0,0 +1,33 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/40705
// { dg-options "-g -dA" }
// { dg-do compile }
// { dg-final { scan-assembler-times "DW_TAG_structure_type" 2 } }
// { dg-final { scan-assembler-times "DW_AT_name: \"foo<1u>\"" 1 } }
// { dg-final { scan-assembler-times "DW_TAG_enumeration_type" 2 } }
// { dg-final { scan-assembler-times "DW_AT_name: \"typedef foo<1u>::type type\"" 1 } }
// { dg-final { scan-assembler-times "DIE (.*) DW_TAG_enumeration_type" 2 } }
// { dg-final { scan-assembler-times "\"e0..\".*DW_AT_name" 1 } }
// { dg-final { scan-assembler-times "\"e1..\".*DW_AT_name" 1 } }
template <unsigned int n>
struct foo
{
public:
typedef
unsigned char type;
};
template<>
struct foo<1>
{
typedef enum { e0, e1 } type;
};
int
main()
{
foo<1> f;
foo<1>::type t = foo<1>::e1;
return t;
}

View File

@ -0,0 +1,12 @@
// Contributed by Dodji Seketeli <dodji@redhat.com>
// Origin: PR c++/40357
// { dg-do compile }
struct XalanCProcessor
{
typedef enum {eInvalid, eXalanSourceTree, eXercesDOM} ParseOptionType;
ParseOptionType getParseOption(void);
};
typedef XalanCProcessor::ParseOptionType ParseOptionType;
ParseOptionType XalanCProcessor::getParseOption(void) {}