re PR c++/77363 (Missing debug information in DWARF)

PR debug/77363
	* dwarf2out.c (modified_type_die): Use lookup_type_die (type)
	instead of lookup_type_die (type_main_variant (type)) even for array
	types.

	* g++.dg/debug/dwarf2/pr77363.C: New test.

From-SVN: r239855
This commit is contained in:
Jakub Jelinek 2016-08-30 08:46:38 +02:00 committed by Jakub Jelinek
parent 26122e2d8a
commit 3754bbfc36
4 changed files with 30 additions and 1 deletions

View File

@ -1,5 +1,10 @@
2016-08-30 Jakub Jelinek <jakub@redhat.com>
PR debug/77363
* dwarf2out.c (modified_type_die): Use lookup_type_die (type)
instead of lookup_type_die (type_main_variant (type)) even for array
types.
PR middle-end/77377
* simplify-rtx.c (avoid_constant_pool_reference): For out of bounds
constant pool reference return x instead of c.

View File

@ -11474,7 +11474,8 @@ modified_type_die (tree type, int cv_quals, bool reverse,
copy was created to help us keep track of typedef names) and
that copy might have a different TYPE_UID from the original
..._TYPE node. */
if (TREE_CODE (type) != VECTOR_TYPE)
if (TREE_CODE (type) != VECTOR_TYPE
&& TREE_CODE (type) != ARRAY_TYPE)
return lookup_type_die (type_main_variant (type));
else
/* Vectors have the debugging information in the type,

View File

@ -1,5 +1,8 @@
2016-08-30 Jakub Jelinek <jakub@redhat.com>
PR debug/77363
* g++.dg/debug/dwarf2/pr77363.C: New test.
PR middle-end/77377
* gcc.target/i386/pr77377.c: New test.

View File

@ -0,0 +1,20 @@
// PR debug/77363
// { dg-options "-gdwarf-2 -dA -fno-merge-debug-strings" }
// { dg-final { scan-assembler "DIE \\(\[^\n\r\]*\\) DW_TAG_typedef\[^\n\r\]*\[\n\r]*\[^\n\r\]*type2\[^\n\r\]* DW_AT_name\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_file\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_line\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_type" } }
// { dg-final { scan-assembler "DIE \\(\[^\n\r\]*\\) DW_TAG_typedef\[^\n\r\]*\[\n\r]*\[^\n\r\]*type3\[^\n\r\]* DW_AT_name\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_file\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_line\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_type" } }
// { dg-final { scan-assembler "DIE \\(\[^\n\r\]*\\) DW_TAG_typedef\[^\n\r\]*\[\n\r]*\[^\n\r\]*type4\[^\n\r\]* DW_AT_name\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_file\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_line\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_type" } }
// { dg-final { scan-assembler "DIE \\(\[^\n\r\]*\\) DW_TAG_typedef\[^\n\r\]*\[\n\r]*\[^\n\r\]*type5\[^\n\r\]* DW_AT_name\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_file\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_decl_line\[^\n\r\]*\[\n\r]*\[^\n\r\]* DW_AT_type" } }
typedef unsigned short type1;
typedef unsigned char type2;
typedef type2 type3[16];
typedef unsigned char type4[16];
typedef struct
{
struct
{
type3 a;
type4 b;
} c;
} type5;
type5 var;